Commit 6bc562d
authored
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.1 parent 939737a commit 6bc562d
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
194 | 198 | | |
195 | 199 | | |
196 | 200 | | |
| |||
0 commit comments