Fix scheduler fairness test

This commit is contained in:
serxa 2024-03-03 17:27:37 +00:00
parent 9c4b15c1c1
commit 34cf2a1671
2 changed files with 2 additions and 2 deletions

View File

@ -282,7 +282,7 @@ struct ResourceTestManager : public ResourceTestBase
return link_data[link];
}
// Use at least two threads for each queue to avoid queue being deactivated:
// Use exactly two threads for each queue to avoid queue being deactivated (happens with 1 thread) and reordering (happens with >2 threads):
// while the first request is executing, the second request is in queue - holding it active.
// use onEnqueue() and onExecute() functions for this purpose.
void onEnqueue(ResourceLink link)

View File

@ -56,7 +56,7 @@ TEST(SchedulerDynamicResourceManager, Fairness)
EXPECT_NEAR(cur_unfairness, 0, 1);
};
constexpr size_t threads_per_queue = 3;
constexpr size_t threads_per_queue = 2;
int requests_per_thread = 100;
ResourceTest t(2 * threads_per_queue + 1);