Repository navigation
Open
Labels
bugSomething isn't workingnon-deterministicAn issue that is difficult to reproduce because it is non-deterministictestingrelated to unit testing in generaltrackingA complex issue broken down into sub-problems
Description
Bug Report
We have several Go test units that fail randomly, are flaky, in particular when running by GitHub (e.g., in pull requests).
The goal of this issue is to keep track of them and define what to with the associated test units. The possibilities include:
- Remove the test unit, justifying the removal through a PR and associated issue. This approach could be taken with test units that are particular hard to fix or understand and whose removal would presumably not affect the correctness of the code, upon the introduction of changes
- Fix the test unit. This is the optimal solution but it takes time, in some cases a lot of time. Notice that at the moment this text is written (Q3-2024), we don't have in our priority list fixing flaky tests.
- Add comments to the code to inform that a particular test unit is flaky, possibly linking the corresponding issue. This does not solve the problem but helps onboarding new collaborators.
Main branch
List of potential flaky tests
List produced by @faddat in January 2024. Links for the failed runs were removed because not available any longer.
- TestAddAndRemoveListenerConcurrency
- TestSwitchDialPeersAsync
- TestOutboundConnectionsNoDuplicate
- non-deterministic test failure in TestTransportMultiplexAcceptNonBlocking #3160
- TestNodeNewNodeGenesisHashMismatch
- TestPEXReactorRunning
- TestNodeNewNodeDeleteGenesisFileFromDB
- TestNodeNewNodeCustomReactors
- TestListenerTimeoutReadWrite is flaky #1915
- TestWriteRPCResponseHTTPError is flaky #1913
- TestByzantinePrevoteEquivocation
- TestWriter
- TestMempoolProgressInHigherRound
- TestReader
- MustReadFile is flaky #1935
- v0.37.x: TestTxMempool_ExpiredTxs_Timestamp
- v0.38.x: TestBadBlockStopsPeer
- v0.38.x: TestByzantinePrevoteEquivocation
- v0.38.x: TestPprofServer
- TestBroadcastTxForPeerStopsWhenPeerStops
- TestMempoolReactorMaxActiveOutboundConnections
- TestTransportHandshake
- TestProvider
Reacted by Anton Kaliaev
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingnon-deterministicAn issue that is difficult to reproduce because it is non-deterministictestingrelated to unit testing in generaltrackingA complex issue broken down into sub-problems
Type
Projects
- StatusShow more project fieldsTodo
Activity
[-]Multiple flaky tests[/-][+]Flaky Test Tracking Issue[/+]faddat commentedon Jan 2, 2024
I've begun to submit fixes to the flaky tests. I would like to urge the maintainers to check the fixes extremely harshly, such that none of the fixes endangers the purpose of any of the tests.
For example, you might try merging all of the fixes to one branch, running ci hundreds of times, and seeing if there are failures.
But I would also recommend that for each of the sumbitted PR's the underlying code be examined just as harshly as its test.
faddat commentedon Jan 19, 2024
I think I figured out
TestReaderSo basically, we're expecting that to do.... something in 0s but it takes 20ms. Also, I kinda think we can tolerate the 20ms.
cometbft/internal/flowrate/io_test.go
Lines 82 to 83 in d766d20
But maybe we cannot? Reviewing this, this looks ... time related? This is looking for idle to always be 0s.
[-]Flaky Test Tracking Issue[/-][+][Tracking issue] flaky tests[/+]fix: increase base ensureTimeout from 200ms to 400ms (#2849)
fix: increase base ensureTimeout from 200ms to 400ms (#2849)
fix: increase base ensureTimeout from 200ms to 400ms (#2849)
fix: increase base ensureTimeout from 200ms to 400ms (backport #2849) (…