Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dial attempt failed: EOF when go test in macOS #96

Open
mhchia opened this issue Aug 14, 2018 · 7 comments
Open

dial attempt failed: EOF when go test in macOS #96

mhchia opened this issue Aug 14, 2018 · 7 comments
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@mhchia
Copy link

mhchia commented Aug 14, 2018

I run the command in both macOS High Sierra(10.13.6) and ubuntu 16.04 and get this issue only in my macOS. I removed the entire $GOPATH/src, and performed go get again. This issue is still there.

$ gx-go rw
$ go test -v
...
=== RUN   TestSparseGossipsub
--- PASS: TestSparseGossipsub (3.00s)
=== RUN   TestDenseGossipsub
--- FAIL: TestDenseGossipsub (0.91s)
	floodsub_test.go:54: dial attempt failed: <peer.ID eQ7kYF> --> <peer.ID SwqzNr> dial attempt failed: EOF
=== RUN   TestGossipsubFanout
--- FAIL: TestGossipsubFanout (1.01s)
	floodsub_test.go:54: dial attempt failed: <peer.ID dMgtPZ> --> <peer.ID SCdsq4> dial attempt failed: EOF
=== RUN   TestGossipsubFanoutMaintenance
--- FAIL: TestGossipsubFanoutMaintenance (0.95s)
	floodsub_test.go:54: dial attempt failed: <peer.ID f8X5mz> --> <peer.ID edj6pD> dial attempt failed: EOF
=== RUN   TestGossipsubFanoutExpiry
--- PASS: TestGossipsubFanoutExpiry (4.53s)
=== RUN   TestGossipsubGossip
--- FAIL: TestGossipsubGossip (1.02s)
	floodsub_test.go:54: dial attempt failed: <peer.ID Y2LATb> --> <peer.ID cmZNWD> dial attempt failed: EOF
=== RUN   TestGossipsubGossipPiggyback
--- FAIL: TestGossipsubGossipPiggyback (1.06s)
	floodsub_test.go:54: dial attempt failed: <peer.ID TixfJG> --> <peer.ID QkahvD> dial attempt failed: EOF
...

After debugging for a while, I still don't have any idea about this issue. I will really appreciate if there is any direction to solve it.

@vyzo
Copy link
Collaborator

vyzo commented Aug 14, 2018

These are misdials lower in the stack; it's probably stale peers and port reuse that's causing this.

@mhchia
Copy link
Author

mhchia commented Aug 14, 2018

@vyzo Thanks a lot for the direction!

it's probably stale peers and port reuse that's causing this.

Sorry, I don't understand why that would happen. IIUC, it seems all of the tests are defer cancel(), so every host should be closed accordingly? It is quite interesting and I would like to dig more into it if it is worth solving:)

@vyzo
Copy link
Collaborator

vyzo commented Aug 14, 2018

Well, Host.Close() cancels a context, which may take time to take effect.

@mhchia
Copy link
Author

mhchia commented Aug 14, 2018

According to this, is it possibly helping if we change defer cancel() to something like

defer func() {
    cancel()
    time.Sleep(time.Millisecond * 100)
}()

in every test? I did it but it seems no effect.

@Stebalien
Copy link
Member

Could be libp2p/go-libp2p-swarm#79.

@vyzo
Copy link
Collaborator

vyzo commented Mar 25, 2020

not a pubsub bug; midials lower in the stack.

@vyzo vyzo closed this as completed Mar 25, 2020
@Stebalien Stebalien reopened this Mar 25, 2020
@Stebalien
Copy link
Member

This is a test failure in pubsub and is therefore a bug in the pubsub tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

4 participants