Skip to content

Commit ebe8d2d

Browse files
authored
Merge pull request #57 from mpretty-cyro/fix/test-port-numbers
Increased the port numbers used by the network tests
2 parents eed2f2d + 1955b64 commit ebe8d2d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/test_session_network.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ service_node test_node(
4747
{2, 8, 0},
4848
INVALID_SWARM_ID,
4949
(unique_ip ? fmt::format("0.0.0.{}", index) : "1.1.1.1"),
50-
index};
50+
static_cast<uint16_t>(10000 + index)};
5151
}
5252

5353
std::optional<service_node> node_for_destination(network_destination destination) {
@@ -246,7 +246,7 @@ class TestNetwork : public Network {
246246
path_nodes.reserve(3);
247247

248248
for (auto i = 0; i < 3; ++i) {
249-
path_servers.emplace_back(create_test_server(static_cast<uint16_t>(1000 + i)));
249+
path_servers.emplace_back(create_test_server(static_cast<uint16_t>(4390 + i)));
250250
path_nodes.emplace_back(path_servers[i]->node);
251251
}
252252

@@ -1072,7 +1072,7 @@ TEST_CASE("Network", "[network][build_path]") {
10721072

10731073
TEST_CASE("Network", "[network][find_valid_path]") {
10741074
auto ed_pk = "4cb76fdc6d32278e3f83dbf608360ecc6b65727934b85d2fb86862ff98c46ab7"_hexbytes;
1075-
auto test_server = create_test_server(500);
1075+
auto test_server = create_test_server(5000);
10761076
auto target = test_node(ed_pk, 1);
10771077
auto info = request_info::make(target, std::nullopt, std::nullopt, 0ms);
10781078

@@ -1221,7 +1221,7 @@ TEST_CASE("Network", "[network][build_path_if_needed]") {
12211221
}
12221222

12231223
TEST_CASE("Network", "[network][establish_connection]") {
1224-
auto test_server = create_test_server(500);
1224+
auto test_server = create_test_server(5100);
12251225
auto network = TestNetwork(std::nullopt, true, true, false);
12261226
std::promise<std::pair<connection_info, std::optional<std::string>>> prom;
12271227

@@ -1248,7 +1248,7 @@ TEST_CASE("Network", "[network][check_request_queue_timeouts]") {
12481248
// Test that it doesn't start checking for timeouts when the request doesn't have
12491249
// a build paths timeout
12501250
network.emplace(std::nullopt, true, true, false);
1251-
test_server.emplace(create_test_server(501));
1251+
test_server.emplace(create_test_server(5201));
12521252
network->send_onion_request(
12531253
(*test_server)->node,
12541254
to_vector("{\"method\":\"info\",\"params\":{}}"),
@@ -1265,7 +1265,7 @@ TEST_CASE("Network", "[network][check_request_queue_timeouts]") {
12651265
// Test that it does start checking for timeouts when the request has a
12661266
// paths build timeout
12671267
network.emplace(std::nullopt, true, true, false);
1268-
test_server.emplace(create_test_server(502));
1268+
test_server.emplace(create_test_server(5202));
12691269
network->ignore_calls_to("build_path");
12701270
network->send_onion_request(
12711271
(*test_server)->node,
@@ -1283,7 +1283,7 @@ TEST_CASE("Network", "[network][check_request_queue_timeouts]") {
12831283
// Test that it fails the request with a timeout if it has a build path timeout
12841284
// and the path build takes too long
12851285
network.emplace(std::nullopt, true, true, false);
1286-
test_server.emplace(create_test_server(503));
1286+
test_server.emplace(create_test_server(5203));
12871287
network->ignore_calls_to("build_path");
12881288
network->send_onion_request(
12891289
(*test_server)->node,
@@ -1307,7 +1307,7 @@ TEST_CASE("Network", "[network][check_request_queue_timeouts]") {
13071307
}
13081308

13091309
TEST_CASE("Network", "[network][send_request]") {
1310-
auto test_server = create_test_server(500);
1310+
auto test_server = create_test_server(5300);
13111311
auto network = TestNetwork(std::nullopt, true, true, false);
13121312
std::promise<Result> prom;
13131313

@@ -1360,7 +1360,7 @@ TEST_CASE("Network", "[network][send_request]") {
13601360
}
13611361

13621362
TEST_CASE("Network", "[network][send_onion_request]") {
1363-
auto test_server = create_test_server(500);
1363+
auto test_server = create_test_server(5400);
13641364
auto network = TestNetwork(std::nullopt, true, true, false);
13651365
auto [test_path_servers, test_path] = network.create_test_path();
13661366
network.handle_onion_requests_as_plaintext = true;
@@ -1402,7 +1402,7 @@ TEST_CASE("Network", "[network][send_onion_request]") {
14021402
}
14031403

14041404
TEST_CASE("Network", "[network][c][network_send_onion_request]") {
1405-
auto test_server_cpp = create_test_server(500);
1405+
auto test_server_cpp = create_test_server(5500);
14061406
auto test_network = std::make_unique<TestNetwork>(std::nullopt, true, true, false);
14071407
std::optional<std::pair<std::vector<std::shared_ptr<TestServer>>, onion_path>> test_path_data;
14081408
test_path_data.emplace(test_network->create_test_path());

0 commit comments

Comments
 (0)