les: fix data races in tests (#23457)

This commit is contained in:
gary rong
2021-08-25 17:56:25 +08:00
committed by GitHub
parent fe2f153b55
commit 83ad92c421
8 changed files with 48 additions and 76 deletions

View File

@ -401,9 +401,9 @@ func testGetTxStatusFromUnindexedPeers(t *testing.T, protocol int) {
closeFns = append(closeFns, closePeer)
// Create a one-time routine for serving message
go func(i int, peer *testPeer) {
serveMsg(peer, testspec.txLookups[i])
}(i, peer)
go func(i int, peer *testPeer, lookup uint64) {
serveMsg(peer, lookup)
}(i, peer, testspec.txLookups[i])
}
// Send out the GetTxStatus requests, compare the result with