Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-15309] Task isCancelled instance property not reporting value correctly #57631

Closed
swift-ci opened this issue Oct 12, 2021 · 3 comments
Closed
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. concurrency Feature: umbrella label for concurrency language features

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-15309
Radar rdar://problem/84146091
Original Reporter tourultimate (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Xcode 13 RC, Swift 5.5

iPhone 12 Pro Simulator

Additional Detail from JIRA
Votes 1
Component/s
Labels Bug, Concurrency
Assignee @ktoso
Priority Medium

md5: 92ab0d5576a0c182a9c51b9e2efb9230

Issue Description:

The `isCancelled` instance property on a Task is not reporting the correct value. This test fails 100/100 times:

```
func testCancelBug() async {
let t = Task {
await Task.yield()
XCTAssertTrue(Task.isCancelled)
}

t.cancel()
XCTAssertTrue(t.isCancelled) // Fails here: XCTAssertTrue failed
}
```

@ktoso
Copy link
Member

ktoso commented Oct 12, 2021

@swift-ci create

@ktoso
Copy link
Member

ktoso commented Oct 12, 2021

Thanks for the report, this indeed looks fishy

@ktoso
Copy link
Member

ktoso commented Oct 13, 2021

For better or worse, this was a very silly bug... Fixed in: #39710

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. concurrency Feature: umbrella label for concurrency language features
Projects
None yet
Development

No branches or pull requests

2 participants