Skip to content

Commit

Permalink
[C++] Shorten test timeouts.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyazelenko committed Feb 7, 2025
1 parent 1e51407 commit 0e77cf4
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions aeron-client/src/test/cpp_wrapper/SystemTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,10 @@ TEST_P(SystemTestParameterized, shouldFreeUnavailableImage)
std::string channel = GetParam();
const int stream_id = 1000;
Context ctx;
ctx.useConductorAgentInvoker(false);
ctx
.useConductorAgentInvoker(false)
.resourceLingerTimeout(5)
.idleSleepDuration(1);

std::shared_ptr<Aeron> aeron = Aeron::connect(ctx);

Expand Down Expand Up @@ -353,6 +356,13 @@ TEST_P(SystemTestParameterized, shouldFreeUnavailableImage)
}
ASSERT_TRUE(image_unavailable);

while (0 != subscription->imageCount())
{
std::this_thread::yield();
}
ASSERT_EQ(0, subscription->imageCount());
ASSERT_EQ(0, aeron_subscription_image_count(raw_subscription));

auto deadline_ns = std::chrono::nanoseconds(m_driver.livenessTimeoutNs());
auto zero_ns = std::chrono::nanoseconds(0);
auto sleep_ms = std::chrono::milliseconds(10);
Expand All @@ -366,8 +376,6 @@ TEST_P(SystemTestParameterized, shouldFreeUnavailableImage)
std::this_thread::sleep_for(sleep_ms);
}
EXPECT_GT(deadline_ns, zero_ns);
EXPECT_EQ(0, subscription->imageCount());
EXPECT_EQ(0, aeron_subscription_image_count(raw_subscription));

EXPECT_EQ(-1, aeron_file_length(image_log_file.c_str())) << image_log_file << " not deleted";
EXPECT_EQ(-1, aeron_file_length(pub_log_file.c_str())) << pub_log_file << " not deleted";
Expand Down

0 comments on commit 0e77cf4

Please sign in to comment.