Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/qt/test/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ int main(int argc, char* argv[])

NodeContext node_context;
std::unique_ptr<interfaces::Node> node = interfaces::MakeNode(&node_context);
gArgs.ForceSetArg("-listen", "0");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing 0 to port lets the system assign a free port number. This fixes the issue while allowing for future GUI tests that involve interactions with another node.

Suggested change
gArgs.ForceSetArg("-listen", "0");
gArgs.ForceSetArg("-port", "0");

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that is necessary at this time. Additionally, I don't think doing this would be useful. In this hypothetical test, the test framework needs to know what port is being used, so I don't think this would help.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true

gArgs.ForceSetArg("-listenonion", "0");
gArgs.ForceSetArg("-discover", "0");
gArgs.ForceSetArg("-dnsseed", "0");
gArgs.ForceSetArg("-fixedseeds", "0");
gArgs.ForceSetArg("-upnp", "0");
gArgs.ForceSetArg("-natpmp", "0");

bool fInvalid = false;

Expand Down