prysm-pulse/shared/p2p/feed_concurrent_test.go
Federico Gimenez b8fe4228af Add Mutex on Top of p2p Feeds Map (#321)
* add mutex on top of p2p feeds map

* lock read too

* add concurrent write test and enable race detector

* restrict race detection to concurrent feed map write test

* gazelle fix

* increase ram and I/O in bazel's local_resources

* reverted local_resources changes

* address review comments

* do not disable sandboxing on travis

* address review comments
2018-07-26 00:11:15 +08:00

15 lines
215 B
Go

package p2p
import "testing"
func TestFeed_ConcurrentWrite(t *testing.T) {
s, err := NewServer()
if err != nil {
t.Fatalf("could not create server %v", err)
}
for i := 0; i < 5; i++ {
go s.Feed("a")
}
}