Skip to content

Commit 1b6f9d5

Browse files
committed
Await cert chain to catch up before asserting resumption in tests
Add extra wait to assert that a paused node is caught up with the cert chain before waiting for an instance to be reached. use additional wait timeout for chain catchup to make sure we avoid flakage on CI. Fixes: #1025
1 parent 20d68df commit 1b6f9d5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

f3_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ func TestF3PauseResumeCatchup(t *testing.T) {
120120
// Resuming node 1 should continue agreeing on instances.
121121
env.resumeNode(1)
122122
env.requireF3RunningEventually(eventualCheckTimeout, nodeMatchers.byID(1))
123+
require.Eventually(t, func() bool {
124+
node0LatestCert, err := env.nodes[0].f3.GetLatestCert(env.testCtx)
125+
require.NoError(t, err)
126+
node1LatestCert, err := env.nodes[1].f3.GetLatestCert(env.testCtx)
127+
require.NoError(t, err)
128+
return node0LatestCert.GPBFTInstance == node1LatestCert.GPBFTInstance
129+
}, eventualCheckTimeout*3, eventualCheckInterval, "Node 1 did not catch up on certs")
123130

124131
// Wait until we're far enough that pure GPBFT catchup should be impossible.
125132
targetInstance := env.nodes[1].currentGpbftInstance() + env.manifest.CommitteeLookback + 1

0 commit comments

Comments
 (0)