Repository navigation
Fix flaky test - #632
Fix flaky test#632
Conversation
It's a flaky CI timing issue: postIndexRefreshSuccess: posts via dispatch_async(main queue, …), and the test's waitForExpectations:timeout:1.0 is tight on a loaded CI runner
There was a problem hiding this comment.
Diagnosis looks right - looks like the wait really was too tight...
The cost is the catch: an inverted expectation burns the whole timeout regardless,
so these two tests go from 1s each to 5s each.
The class goes 2.0s to 10.0s, and the full suite from 6.2s to about 14s.
Every other test in the class runs in 0.001s.
Splitting the wait gets the headroom without paying for it:
[self waitForExpectations:@[ statusReported ] timeout:5.0];
[self waitForExpectations:@[ indexAnnounced ] timeout:0.1];
The first returns as soon as the notification lands but still tolerates a 5 second stall, so the flaky half is covered.
|
We can wait to see how often it appears. |
|
I would fix this one, including the above small modification - it saves 5 seconds and still keeps the longer delay where it is required. |




I see it here https://github.com/gitx/gitx/actions/runs/34750376507/job/103705883239?pr=625
It's a flaky CI timing issue: postIndexRefreshSuccess: posts via dispatch_async(main queue, …), and the test's waitForExpectations:timeout:1.0 is tight on a loaded CI runner
close #631