Skip to content

🍒 [Concurrency] Harden async_task_locals_copy_to_sync #39623

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

Merged

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Oct 6, 2021

Description: The test naively assumed the code will complete quickly and did a sleep after the spawning of a Task{} -- this leads to flaky behavior on slow machines. The test specifically must create tasks from synchronous code, to exercise the code-path for such context. This means we're not really able to use await as it would cause the test not utilize the intended code path. This change makes use of a semaphore instead of a naive sleep to stabilize the test.
Risk: Low, test-only change
Review by: @DougGregor
Testing: PR validation on main and 5.5 branches
Original PR: #39621
Radar: rdar://83940885

@ktoso ktoso requested a review from a team as a code owner October 6, 2021 22:46
@ktoso ktoso requested a review from DougGregor October 6, 2021 22:46
@ktoso
Copy link
Contributor Author

ktoso commented Oct 6, 2021

@swift-ci please test

@ktoso ktoso changed the title [Concurrency] Harden async_task_locals_copy_to_sync 🍒 [Concurrency] Harden async_task_locals_copy_to_sync Oct 6, 2021
@ktoso
Copy link
Contributor Author

ktoso commented Oct 7, 2021

@swift-ci please nominate

@DougGregor DougGregor merged commit 031fc5d into swiftlang:release/5.5 Oct 7, 2021
@ktoso ktoso deleted the pick-harden-task-local-copy-test branch October 13, 2021 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants