Skip to content

Commit

Permalink
chore: increase timers for more stable test runs
Browse files Browse the repository at this point in the history
  • Loading branch information
MatusKysel committed May 12, 2023
1 parent 21ef2c7 commit d964baf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tests/network_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ TEST_F(NetworkTest, transfer_block) {
SharedTransactions transactions({g_signed_trx_samples[0], g_signed_trx_samples[1]});
nw2->getSpecificHandler<network::tarcap::TransactionPacketHandler>()->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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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();
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/p2p_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ TEST_F(P2PTest, multiple_capabilities) {
std::filesystem::remove_all("/tmp/nw3");
};
auto wait_for_connection = [](std::shared_ptr<Network> nw1, std::shared_ptr<Network> nw2) {
EXPECT_HAPPENS({15s, 500ms}, [&](auto &ctx) {
EXPECT_HAPPENS({60s, 100ms}, [&](auto &ctx) {
nw1->setPendingPeersToReady();
nw2->setPendingPeersToReady();
WAIT_EXPECT_EQ(ctx, nw1->getPeerCount(), 1)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_util/src/test_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ std::vector<taraxa::FullNodeConfig> NodesTest::make_node_cfgs(size_t total_count

bool NodesTest::wait_connect(const std::vector<std::shared_ptr<taraxa::FullNode>>& 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;
Expand Down

0 comments on commit d964baf

Please sign in to comment.