Skip to content

Commit

Permalink
Merge pull request #2719 from Juliusan/snapshot
Browse files Browse the repository at this point in the history
Attempt to fix flaky TestMempoolSnapshotInTheMiddle
  • Loading branch information
Juliusan committed Jul 16, 2023
2 parents a04f00f + 32203dc commit a7a3887
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/chain/statemanager/sm_gpa/state_manager_gpa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,10 @@ func TestMempoolSnapshotInTheMiddle(t *testing.T) {
responseCh := env.sendChainFetchStateDiff(oldCommitment, newCommitment, nodeIDs[1])
require.True(env.t, snapm1.WaitSnapshotLoadRequestCount(1, 10*time.Millisecond, 100)) // To allow snapshot manager to receive load old state snapshot request
env.sendTimerTickToNodes(100 * time.Millisecond) // To check the response from snapshot manager about loaded old state snapshot; timer tick is not necessary: any input would be suitable
require.True(env.t, snapm1.WaitSnapshotLoadedCount(1, 10*time.Millisecond, 100)) // To allow snapshot manager thread to wake up and respond
require.True(env.t, snapm1.WaitSnapshotLoadRequestCount(2, 10*time.Millisecond, 100)) // To allow snapshot manager to receive load new state snapshot request
env.sendTimerTickToNodes(100 * time.Millisecond) // To check the response from snapshot manager about loaded new state snapshot; timer tick is not necessary: any input would be suitable
require.True(env.t, snapm1.WaitSnapshotLoadedCount(2, 10*time.Millisecond, 100)) // To allow snapshot manager thread to wake up and respond
require.True(env.t, env.ensureCompletedChainFetchStateDiff(responseCh, oldBlocks[branchIndex+1:], newBlocks, 10, 100*time.Millisecond))
}

Expand Down

0 comments on commit a7a3887

Please sign in to comment.