Skip to content

Commit

Permalink
Fix qa_Scheduler, increase waiting time, add additional checks
Browse files Browse the repository at this point in the history
Signed-off-by: drslebedev <[email protected]>
  • Loading branch information
drslebedev committed Jan 17, 2025
1 parent cb27fc1 commit 08e5343
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/test/qa_Scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -682,15 +682,20 @@ const boost::ut::suite<"SchedulerTests"> SchedulerTests = [] {
expect(scheduler.state() == lifecycle::State::RUNNING) << "scheduler thread up and running";

auto oldProgress = scheduler.graph().progress().value();
expect(awaitCondition(1s, [&scheduler, &oldProgress] { // wait until there is no more progress (i.e. wait until all initial buffers are filled)
std::this_thread::sleep_for(100ms); // wait
expect(awaitCondition(2s, [&scheduler, &oldProgress] { // wait until there is no more progress (i.e. wait until all initial buffers are filled)
std::this_thread::sleep_for(200ms); // wait
auto newProgress = scheduler.graph().progress().value();
if (oldProgress == newProgress) {
return true;
}
oldProgress = newProgress;
return false;
})) << "BusyLoopBlock sleeping";

// check that buffers are full
expect(eq(source.out.streamWriter().available(), 0UZ));
expect(eq(monitor.in.streamReader().available(), graph::defaultMinBufferSize));

const auto progressAfterInit = scheduler.graph().progress().value();
auto estInvokeCount = [&monitor] {
const auto invokeCountInit = monitor._invokeCount.value();
Expand Down

0 comments on commit 08e5343

Please sign in to comment.