Skip to content

Commit 6e00604

Browse files
authored
Fix F3 flaky tests (#1023)
* Investigate flaky F3 tests Attempt to reproduce flaky tests on CI. * Adjust test progress velocity * Reduce increment and check granularity in tests * Disable parallel test runs * Bump CI timeout in checking that tests are unflaked * Parallelise race detector test runs * Re-enable parallel test runs and bump eventual timeout * Disable paralle tests * Tests now look stable, remove the CI flaky test run
1 parent f46fd35 commit 6e00604

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

f3_test.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"github.com/ipfs/go-datastore"
2222
"github.com/ipfs/go-datastore/failstore"
2323
ds_sync "github.com/ipfs/go-datastore/sync"
24+
logging "github.com/ipfs/go-log/v2"
2425
pubsub "github.com/libp2p/go-libp2p-pubsub"
2526
"github.com/libp2p/go-libp2p/core/host"
2627
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
@@ -29,8 +30,8 @@ import (
2930
)
3031

3132
const (
32-
eventualCheckInterval = 100 * time.Millisecond
33-
eventualCheckTimeout = time.Minute
33+
eventualCheckInterval = 5 * time.Millisecond
34+
eventualCheckTimeout = 2 * time.Minute
3435
advanceClockEvery = 5 * time.Millisecond
3536
advanceClockBy = 100 * time.Millisecond
3637
)
@@ -44,14 +45,15 @@ func init() {
4445
}
4546

4647
func TestF3Simple(t *testing.T) {
47-
t.Parallel()
4848
env := newTestEnvironment(t).withNodes(2).start()
4949
env.requireInstanceEventually(5, eventualCheckTimeout, true)
5050
env.requireEpochFinalizedEventually(env.manifest.BootstrapEpoch, eventualCheckTimeout)
5151
}
5252

5353
func TestF3WithLookback(t *testing.T) {
54-
t.Parallel()
54+
// Quiet down the logs since the test asserts a scenario that triggers
55+
// OhShitStore ERROR level logs.
56+
_ = logging.SetLogLevel("f3/ohshitstore", "DPANIC")
5557

5658
mfst := base
5759
mfst.EC.HeadLookback = 20
@@ -93,7 +95,10 @@ func TestF3WithLookback(t *testing.T) {
9395
}
9496

9597
func TestF3PauseResumeCatchup(t *testing.T) {
96-
t.Parallel()
98+
// Quiet down the logs since the test asserts a scenario that triggers
99+
// OhShitStore ERROR level logs.
100+
_ = logging.SetLogLevel("f3/ohshitstore", "DPANIC")
101+
97102
env := newTestEnvironment(t).withNodes(3).start()
98103
env.requireInstanceEventually(1, eventualCheckTimeout, true)
99104
env.requireEpochFinalizedEventually(env.manifest.BootstrapEpoch, eventualCheckTimeout)
@@ -136,7 +141,6 @@ func TestF3PauseResumeCatchup(t *testing.T) {
136141
}
137142

138143
func TestF3FailRecover(t *testing.T) {
139-
t.Parallel()
140144
env := newTestEnvironment(t).withNodes(2)
141145

142146
// Make it possible to fail a single write for node 0.
@@ -167,7 +171,6 @@ func TestF3FailRecover(t *testing.T) {
167171
}
168172

169173
func TestF3LateBootstrap(t *testing.T) {
170-
t.Parallel()
171174
env := newTestEnvironment(t).withNodes(2).start()
172175

173176
// Wait till we're "caught up".

0 commit comments

Comments
 (0)