p2p/protocols: fix data race in TestProtocolHook (#19242)
dummyHook's fields were concurrently written by nodes and read by
the test. The simplest solution is to protect all fields with a mutex.
Enable: TestMultiplePeersDropSelf, TestMultiplePeersDropOther as they
seemingly accidentally stayed disabled during a refactor/rewrite
since 1836366ac1
.
resolves ethersphere/go-ethereum#1286
This commit is contained in:
committed by
Viktor Trón
parent
bb55b0fb53
commit
f82185a4a1
@ -161,7 +161,7 @@ func TestAccountingSimulation(t *testing.T) {
|
||||
type matrix struct {
|
||||
n int //number of nodes
|
||||
m []int64 //array of balances
|
||||
lock sync.RWMutex
|
||||
lock sync.Mutex
|
||||
}
|
||||
|
||||
// create a new matrix
|
||||
|
Reference in New Issue
Block a user