Skip to content

Fix a non-deterministic test failure in the task scheduler #1331

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
merged 1 commit into from
May 22, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented May 22, 2024

We were calling TaskScheduler.schedule inside a Task in TaskSchedulerTests. This means that Swift concurrency could re-order the execution of those tasks and thus change the order in which tasks were enqueued to the TaskScheduler.

Caused by ahoppen@e295a4e#diff-6a451b3244d65ded9386e2816360b7b1debbe6a519e3795d2046c7dbefa7a7d7R351

@ahoppen ahoppen requested review from bnbarham and hamishknight May 22, 2024 15:20
@ahoppen ahoppen requested a review from benlangmuir as a code owner May 22, 2024 15:20
@ahoppen
Copy link
Member Author

ahoppen commented May 22, 2024

@swift-ci Please test

We were calling `TaskScheduler.schedule` inside a `Task` in `TaskSchedulerTests`. This means that Swift concurrency could re-order the execution of those tasks and thus change the order in which tasks were enqueued to the `TaskScheduler`.

Caused by e295a4e#diff-6a451b3244d65ded9386e2816360b7b1debbe6a519e3795d2046c7dbefa7a7d7R351
@ahoppen ahoppen force-pushed the await-scheduling branch from 86d13fb to 9757181 Compare May 22, 2024 16:17
@ahoppen
Copy link
Member Author

ahoppen commented May 22, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented May 22, 2024

@swift-ci Please test Windows

2 similar comments
@ahoppen
Copy link
Member Author

ahoppen commented May 22, 2024

@swift-ci Please test Windows

@ahoppen
Copy link
Member Author

ahoppen commented May 22, 2024

@swift-ci Please test Windows

@ahoppen
Copy link
Member Author

ahoppen commented May 22, 2024

@swift-ci Please test macOS

@ahoppen ahoppen merged commit 406fb7e into swiftlang:main May 22, 2024
3 checks passed
@ahoppen ahoppen deleted the await-scheduling branch May 22, 2024 19:46
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