vacp2p / mvds

Minimal Viable Data Sync Implementation
https://specs.vac.dev/specs/mvds.html
MIT License
13 stars 3 forks source link

TestMVDSInteractiveSuite ocasionally fails #87

Open richard-ramos opened 3 years ago

richard-ramos commented 3 years ago

To trigger this failure, execute the test with a high --count value to increase the probabilities of it failing:

go test -v ./... -count=100 --run TestMVDSInteractiveSuite

panic: send on closed channel

goroutine 47 [running]:
github.com/vacp2p/mvds/node.(*Node).pushToSub(...)
    /home/richard/status/mvds/node/node.go:705
github.com/vacp2p/mvds/node.(*Node).resolveEventually(0xc000326700, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/richard/status/mvds/node/node.go:600 +0x31c
github.com/vacp2p/mvds/node.(*Node).resolve(0xc000326700, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/richard/status/mvds/node/node.go:591 +0x85
github.com/vacp2p/mvds/node.(*Node).onMessage(0xc000326700, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xaa1d00, ...)
    /home/richard/status/mvds/node/node.go:557 +0x7db
github.com/vacp2p/mvds/node.(*Node).onMessages(0xc000326700, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc000039c00, ...)
    /home/richard/status/mvds/node/node.go:499 +0x165
github.com/vacp2p/mvds/node.(*Node).onPayload(0xc000326700, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/richard/status/mvds/node/node.go:406 +0x765
created by github.com/vacp2p/mvds/node.(*Node).Start.func1
    /home/richard/status/mvds/node/node.go:196 +0x105
FAIL    github.com/vacp2p/mvds  0.158s
richard-ramos commented 3 years ago

Not sure who should look at this :thinking:

decanus commented 3 years ago

Could be because of the wait time here: https://github.com/vacp2p/mvds/blob/master/mvds_interactive_test.go#L87-L90