This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
Avoid port conflicts in acceptance tests #1025
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…wn before we write the ports file Include the P2P TCP port in ports file even when peer discovery is disabled. Load information from the advertised peer rather than the discovery listening socket. Fix admin_nodeInfo to include the ?discport param in the enode URI when the discovery port differs from the P2P port.
…e which isn't responding doesn't return an error. P2P disabled nodes never open the port so this is equivalent.
CjHare
reviewed
Mar 4, 2019
...ptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/PantheonNode.java
Show resolved
Hide resolved
…is if needed. Avoids duplication of bootnodes.
lucassaldanha
approved these changes
Mar 4, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 🚀
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR description
Acceptance tests were attempting to find an available port by starting a socket server with port 0, stopping it then assuming that port would remain unused which led to a lot of test failures when Pantheon failed to start up because of a port conflict.
This PR changes the behaviour so that Pantheon is always started with port 0 as the p2p port and then the port is read out of the
pantheon.ports
file. As a result, we need to start a cluster by first starting one node as the bootnode, getting it's enode URL (which requires the port) and then starting the others using that bootnode. The peer discovery process then ensures all peers in the cluster wind up connected to each other without requiring them all to be in the bootnode list.Note this builds on the fixes in #1021, #1020, #1019 and #1018. The changeset will be much easier to review once they've been merged.