test: deflake TestAddAndRemoveListenerConcurrency and TestSyncer_SyncAny (#5101)

Fixes #5094.
This commit is contained in:
Erik Grinaker
2020-07-08 15:33:50 +02:00
committed by GitHub
parent ab20f3520f
commit bf3c87c864
2 changed files with 7 additions and 4 deletions

View File

@@ -189,6 +189,8 @@ func TestSyncer_SyncAny(t *testing.T) {
newState, lastCommit, err := syncer.SyncAny(0)
require.NoError(t, err)
time.Sleep(50 * time.Millisecond) // wait for peers to receive requests
chunkRequestsMtx.Lock()
assert.Equal(t, map[uint32]int{0: 1, 1: 2, 2: 1}, chunkRequests)
chunkRequestsMtx.Unlock()