Skip to content

Commit

Permalink
test/rgw: increase timeouts in unittest_rgw_dmclock_scheduler
Browse files Browse the repository at this point in the history
1ms sleeps are generally below the timer's resolution. increase run_for()
durations to 50ms to make the tests far less sensitive to timing. in
practice, none of the sleeps actually wait the full 50ms

Fixes: https://tracker.ceph.com/issues/64568

Signed-off-by: Casey Bodley <cbodley@redhat.com>
  • Loading branch information
cbodley committed Feb 26, 2024
1 parent e7ecafc commit b4f3ddf
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/test/rgw/test_rgw_dmclock_scheduler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ TEST(Queue, RateLimit)
EXPECT_EQ(1u, counters(client_id::admin)->get(queue_counters::l_qlen));
EXPECT_EQ(1u, counters(client_id::auth)->get(queue_counters::l_qlen));

context.run_for(std::chrono::milliseconds(1));
context.run_for(std::chrono::milliseconds(50));
EXPECT_TRUE(context.stopped());

ASSERT_TRUE(ec1);
Expand Down Expand Up @@ -163,7 +163,7 @@ TEST(Queue, AsyncRequest)
EXPECT_EQ(1u, counters(client_id::admin)->get(queue_counters::l_qlen));
EXPECT_EQ(1u, counters(client_id::auth)->get(queue_counters::l_qlen));

context.run_for(std::chrono::milliseconds(1));
context.run_for(std::chrono::milliseconds(50));
EXPECT_TRUE(context.stopped());

ASSERT_TRUE(ec1);
Expand Down Expand Up @@ -217,7 +217,7 @@ TEST(Queue, Cancel)
EXPECT_FALSE(ec1);
EXPECT_FALSE(ec2);

context.run_for(std::chrono::milliseconds(1));
context.run_for(std::chrono::milliseconds(50));
EXPECT_TRUE(context.stopped());

ASSERT_TRUE(ec1);
Expand Down Expand Up @@ -265,7 +265,7 @@ TEST(Queue, CancelClient)
EXPECT_FALSE(ec1);
EXPECT_FALSE(ec2);

context.run_for(std::chrono::milliseconds(1));
context.run_for(std::chrono::milliseconds(50));
EXPECT_TRUE(context.stopped());

ASSERT_TRUE(ec1);
Expand Down Expand Up @@ -315,7 +315,7 @@ TEST(Queue, CancelOnDestructor)
EXPECT_FALSE(ec1);
EXPECT_FALSE(ec2);

context.run_for(std::chrono::milliseconds(1));
context.run_for(std::chrono::milliseconds(50));
EXPECT_TRUE(context.stopped());

ASSERT_TRUE(ec1);
Expand Down Expand Up @@ -369,20 +369,20 @@ TEST(Queue, CrossExecutorRequest)
EXPECT_EQ(1u, counters(client_id::admin)->get(queue_counters::l_qlen));
EXPECT_EQ(1u, counters(client_id::auth)->get(queue_counters::l_qlen));

callback_context.run_for(std::chrono::milliseconds(1));
callback_context.poll();
// maintains work on callback executor while in queue
EXPECT_FALSE(callback_context.stopped());

EXPECT_FALSE(ec1);
EXPECT_FALSE(ec2);

queue_context.run_for(std::chrono::milliseconds(1));
queue_context.run_for(std::chrono::milliseconds(50));
EXPECT_TRUE(queue_context.stopped());

EXPECT_FALSE(ec1); // no callbacks until callback executor runs
EXPECT_FALSE(ec2);

callback_context.run_for(std::chrono::milliseconds(1));
callback_context.run_for(std::chrono::milliseconds(50));
EXPECT_TRUE(callback_context.stopped());

ASSERT_TRUE(ec1);
Expand Down Expand Up @@ -421,7 +421,7 @@ TEST(Queue, SpawnAsyncRequest)
EXPECT_EQ(PhaseType::priority, p2);
});

context.run_for(std::chrono::milliseconds(1));
context.run_for(std::chrono::milliseconds(50));
EXPECT_TRUE(context.stopped());
}

Expand Down

0 comments on commit b4f3ddf

Please sign in to comment.