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

some p2p tests fail when port is in use #1344

Closed
wildmolasses opened this issue Jan 18, 2019 · 5 comments
Closed

some p2p tests fail when port is in use #1344

wildmolasses opened this issue Jan 18, 2019 · 5 comments
Assignees
Labels
Bug Something isn't working

Comments

@wildmolasses
Copy link
Contributor

When running my ipfs daemon, or when running beacon chain (@prestonvanloon), the following tests fail:

//shared/p2p:go_default_test                                             FAILED in 8.7s
  /private/var/tmp/_bazel_ed/eaff1278acd2faea992dee5290fd6552/execroot/__main__/bazel-out/darwin-fastbuild/testlogs/shared/p2p/go_default_test/test.log
//shared/p2p:go_norace_test                                              FAILED in 0.6s
  /private/var/tmp/_bazel_ed/eaff1278acd2faea992dee5290fd6552/execroot/__main__/bazel-out/darwin-fastbuild/testlogs/shared/p2p/go_norace_test/test.log

When I exit my ipfs daemon the tests pass.

@prestonvanloon 's thought from discord:

Yeah it seems to die if this common port is in use
Same error if you try to run the tests with a beacon node running
Some peer count expectations fail
If you could file a bug, I will look into it but I don’t know if there is anything that can be done because p2p nodes wanna connect to each other
I wonder if I can sandbox the test from the network 🤔🤔🤔
That’s probably the answer

@wildmolasses wildmolasses changed the title p2p tests fail when port is in use some p2p tests fail when port is in use Jan 18, 2019
@prestonvanloon prestonvanloon self-assigned this Jan 18, 2019
@prestonvanloon
Copy link
Member

More to this: the p2p tests expect there to be no other libp2p peer within discovery. So the tests are creating a libp2p node and inadvertently connecting to the ipfs node. This changes some test expectations with discovery, among other things.

The ideal solution is to execute this test within a network sandbox or some virtual environment.

@prestonvanloon prestonvanloon added the Bug Something isn't working label Jan 18, 2019
@prestonvanloon prestonvanloon added this to the Backlog milestone Jan 18, 2019
@wildmolasses
Copy link
Contributor Author

It seems bazel doesn't support network sandboxing on mac osx.

@prestonvanloon
Copy link
Member

The solution is to add the following tag

tags = ["block-network"],

As @wildmolasses, this isn't support on Mac (yet) but would still be an improvement.
This is blocked by #1524 as tests will fail without a network connection.

@rauljordan
Copy link
Contributor

Can this be closed @prestonvanloon ?

@prestonvanloon
Copy link
Member

Yeah, should be OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants