From d964bafb279d4d9644404ff152cd5b34a736fd9b Mon Sep 17 00:00:00 2001 From: Matus Kysel Date: Fri, 12 May 2023 17:01:27 +0200 Subject: [PATCH] chore: increase timers for more stable test runs --- tests/network_test.cpp | 8 ++++---- tests/p2p_test.cpp | 2 +- tests/test_util/src/test_util.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/network_test.cpp b/tests/network_test.cpp index c8097b8440..d40c6d94ab 100644 --- a/tests/network_test.cpp +++ b/tests/network_test.cpp @@ -52,7 +52,7 @@ TEST_F(NetworkTest, transfer_block) { SharedTransactions transactions({g_signed_trx_samples[0], g_signed_trx_samples[1]}); nw2->getSpecificHandler()->onNewTransactions(std::move(transactions)); - EXPECT_HAPPENS({10s, 200ms}, [&](auto& ctx) { + EXPECT_HAPPENS({60s, 100ms}, [&](auto& ctx) { nw1->setPendingPeersToReady(); nw2->setPendingPeersToReady(); WAIT_EXPECT_EQ(ctx, nw1->getPeerCount(), 1) @@ -318,7 +318,7 @@ TEST_F(NetworkTest, transfer_transaction) { nw1->start(); nw2->start(); - EXPECT_HAPPENS({20s, 100ms}, [&](auto& ctx) { + EXPECT_HAPPENS({60s, 100ms}, [&](auto& ctx) { nw1->setPendingPeersToReady(); nw2->setPendingPeersToReady(); WAIT_EXPECT_EQ(ctx, nw1->getPeerCount(), 1) @@ -365,7 +365,7 @@ TEST_F(NetworkTest, save_network) { nw2->start(); nw3->start(); - EXPECT_HAPPENS({120s, 500ms}, [&](auto& ctx) { + EXPECT_HAPPENS({120s, 100ms}, [&](auto& ctx) { nw1->setPendingPeersToReady(); nw2->setPendingPeersToReady(); nw3->setPendingPeersToReady(); @@ -382,7 +382,7 @@ TEST_F(NetworkTest, save_network) { nw2->start(); nw3->start(); - EXPECT_HAPPENS({120s, 500ms}, [&](auto& ctx) { + EXPECT_HAPPENS({120s, 100ms}, [&](auto& ctx) { nw2->setPendingPeersToReady(); nw3->setPendingPeersToReady(); WAIT_EXPECT_EQ(ctx, nw2->getPeerCount(), 1) diff --git a/tests/p2p_test.cpp b/tests/p2p_test.cpp index 1e9dcf31be..9a215160a7 100644 --- a/tests/p2p_test.cpp +++ b/tests/p2p_test.cpp @@ -311,7 +311,7 @@ TEST_F(P2PTest, multiple_capabilities) { std::filesystem::remove_all("/tmp/nw3"); }; auto wait_for_connection = [](std::shared_ptr nw1, std::shared_ptr nw2) { - EXPECT_HAPPENS({15s, 500ms}, [&](auto &ctx) { + EXPECT_HAPPENS({60s, 100ms}, [&](auto &ctx) { nw1->setPendingPeersToReady(); nw2->setPendingPeersToReady(); WAIT_EXPECT_EQ(ctx, nw1->getPeerCount(), 1) diff --git a/tests/test_util/src/test_util.cpp b/tests/test_util/src/test_util.cpp index 7c045c3df4..7c13b18e86 100644 --- a/tests/test_util/src/test_util.cpp +++ b/tests/test_util/src/test_util.cpp @@ -302,7 +302,7 @@ std::vector NodesTest::make_node_cfgs(size_t total_count bool NodesTest::wait_connect(const std::vector>& nodes) { auto num_peers_connected = nodes.size() - 1; - return wait({30s, 1s}, [&](auto& ctx) { + return wait({60s, 100ms}, [&](auto& ctx) { for (const auto& node : nodes) { if (ctx.fail_if(node->getNetwork()->getPeerCount() < num_peers_connected)) { return;