Skip to content

Conversation

@ahoppen
Copy link
Member

@ahoppen ahoppen commented Mar 11, 2025

I just received the following recordings during local test execution:

Set([high(1), high(0)])
Set([high(1), high(0), high(2)])
Set([high(2), high(3), high(1), high(0)])
Set([high(2), high(3), high(1)])
Set([high(2), high(3)])
Set([high(2), high(3), high(4)])
Set([high(2), high(3), high(4), high(5)])
Set([high(3), high(4), high(5)])
Set([high(4), high(5)])
Set([high(4), high(5), high(6)])
Set([high(7), high(4), high(5), high(6)])
Set([high(7), high(5), high(6)])
Set([high(7), high(5)])
Set([high(5)])
Set([])
Set([low(0)])
Set([low(0), high(8)])
Set([low(0), high(8), low(1)])
Set([low(0), high(8), low(1), high(9)])
Set([low(0), high(8), low(1)])
Set([low(0), low(1)])
Set([low(1)])
Set([])
...

These recordings didn't satisfy the old assertion because a low-priority task started executing before the last high-priority task. But really what happened is that low(0), high(8), low(1), and high(9) were all scheduled simultaneously and low(0) just happened to start executing a tiny bit before high(8). To account for these races, relax the assertion to check that all high-priority tasks start executing before the first low-priority task finishes executing.

…rityTasks`

I just received the following recordings during local test execution:

```
Set([high(1), high(0)])
Set([high(1), high(0), high(2)])
Set([high(2), high(3), high(1), high(0)])
Set([high(2), high(3), high(1)])
Set([high(2), high(3)])
Set([high(2), high(3), high(4)])
Set([high(2), high(3), high(4), high(5)])
Set([high(3), high(4), high(5)])
Set([high(4), high(5)])
Set([high(4), high(5), high(6)])
Set([high(7), high(4), high(5), high(6)])
Set([high(7), high(5), high(6)])
Set([high(7), high(5)])
Set([high(5)])
Set([])
Set([low(0)])
Set([low(0), high(8)])
Set([low(0), high(8), low(1)])
Set([low(0), high(8), low(1), high(9)])
Set([low(0), high(8), low(1)])
Set([low(0), low(1)])
Set([low(1)])
Set([])
...
```

These recordings didn't satisfy the old assertion because a low-priority task started executing before the last high-priority task. But really what happened is that `low(0)`, `high(8)`, `low(1)`, and `high(9)` were all scheduled simultaneously and `low(0)` just happened to start executing a tiny bit before `high(8)`. To account for these races, relax the assertion to check that all high-priority tasks start executing before the first low-priority task finishes executing.
@ahoppen
Copy link
Member Author

ahoppen commented Mar 11, 2025

@swift-ci Please test

@ahoppen ahoppen merged commit 9917c7c into swiftlang:main Mar 12, 2025
3 checks passed
@ahoppen ahoppen deleted the task-scheduler-test-relax branch March 12, 2025 21:21
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