Skip to content

Commit 939defb

Browse files
committed
Fix data race in test
1 parent 45d051d commit 939defb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

gossipsub_spam_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,9 @@ func TestGossipsubAttackSpamIDONTWANT(t *testing.T) {
856856
})
857857
}
858858
// The host should receives this message id because the maximum was reached
859+
mu.Lock()
859860
expMid = mid
861+
mu.Unlock()
860862

861863
// Wait for a short interval to make sure the middle peer
862864
// received and processed the IDONTWANTs

0 commit comments

Comments
 (0)