Fix flaky collector tests#2079
Conversation
Greptile SummaryRaises the default
Confidence Score: 5/5Safe to merge — the only change is a larger default timeout that reduces test flakiness without affecting production code. A single default argument is bumped from 5 s to 15 s in a test utility class. No logic, no data flow, and no production paths are touched. The only observable consequence is that genuinely broken tests take longer to report a timeout failure, which is an acceptable trade-off for eliminating false flakiness under heavy parallelism. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Test as Test / Publisher
participant CC as CallbackCollector
participant EV as threading.Event
Test->>CC: "CallbackCollector(n=3, timeout=15.0)"
activate CC
CC->>EV: Event()
deactivate CC
loop publish n messages
Test->>CC: collector(msg, topic)
CC->>CC: results.append((msg, topic))
alt "len(results) >= n"
CC->>EV: set()
end
end
Test->>CC: wait()
CC->>EV: "wait(timeout=15.0)"
alt Event set within 15 s
EV-->>CC: True
CC-->>Test: returns (success)
else Timeout after 15 s
EV-->>CC: False
CC-->>Test: raises AssertionError
end
Reviews (1): Last reviewed commit: "Fix flaky collector tests" | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Problem
Some of the tests using the collector are flaky due to having more CPU contention with xdist.
Solution
Raise the timeouts further to handle this.