You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adjust a timing-sensitive TimeLimitTrait test to avoid flakiness in CI (#1029)
This adjusts the `TimeLimitTraitTests.cancelledTestExitsEarly()` test
function to make it less sensitive to running on resource-constrained CI
systems.
### Motivation:
Recently on a few PRs I have seen flaky results from this test which are
unrelated to my work. They typically show up as console output such as:
```
✘ Test "Cancelled tests can exit early (cancellation checking works)" recorded an issue
at TimeLimitTraitTests.swift:193:5: Expectation failed:
(timeAwaited → 5.108262525 seconds) < (.seconds(5) → 5.0 seconds)
```
This indicates the test is just a little too sensitive to specific
timing.
### Modifications:
- Lengthen the "full" sleep duration the test would run if it wasn't
cancelled, which it is.
- Extend the much shorter duration it allows for waiting, to avoid false
positives when running on resource-constrained CI systems.
### Checklist:
- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
0 commit comments