mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-03 12:16:27 -04:00
Tune creation of seed node address in network stress test
This commit is contained in:
parent
f238870bce
commit
f7625796c8
1 changed files with 3 additions and 2 deletions
|
@ -2,6 +2,7 @@ package io.bitsquare.p2p.network;
|
||||||
|
|
||||||
import io.bitsquare.p2p.NodeAddress;
|
import io.bitsquare.p2p.NodeAddress;
|
||||||
import io.bitsquare.p2p.P2PServiceListener;
|
import io.bitsquare.p2p.P2PServiceListener;
|
||||||
|
import io.bitsquare.p2p.Utils;
|
||||||
import io.bitsquare.p2p.seed.SeedNode;
|
import io.bitsquare.p2p.seed.SeedNode;
|
||||||
import javafx.beans.property.BooleanProperty;
|
import javafx.beans.property.BooleanProperty;
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
|
@ -41,7 +42,7 @@ public class NetworkStressTest {
|
||||||
// Create and start the seed node.
|
// Create and start the seed node.
|
||||||
seedNode = new SeedNode(tempDir.toString());
|
seedNode = new SeedNode(tempDir.toString());
|
||||||
final NodeAddress seedNodeAddress = getSeedNodeAddress();
|
final NodeAddress seedNodeAddress = getSeedNodeAddress();
|
||||||
final boolean useLocalhost = seedNodeAddress.getFullAddress().startsWith("localhost:");
|
final boolean useLocalhost = seedNodeAddress.hostName.equals("localhost");
|
||||||
final Set<NodeAddress> seedNodes = new HashSet<>(1);
|
final Set<NodeAddress> seedNodes = new HashSet<>(1);
|
||||||
seedNodes.add(seedNodeAddress); // the only seed node in tests
|
seedNodes.add(seedNodeAddress); // the only seed node in tests
|
||||||
seedNode.createAndStartP2PService(seedNodeAddress, useLocalhost,
|
seedNode.createAndStartP2PService(seedNodeAddress, useLocalhost,
|
||||||
|
@ -58,7 +59,7 @@ public class NetworkStressTest {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private static NodeAddress getSeedNodeAddress() {
|
private static NodeAddress getSeedNodeAddress() {
|
||||||
return new NodeAddress("localhost:8002");
|
return new NodeAddress("localhost", Utils.findFreeSystemPort());
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue