Fix WorkerThreadTest

Queue capacity needs to be NUM_TASKS + 1 for the extra final cv.notify
at the end.

Test: atest --host --rerun-until-failure 1000 WorkerThreadTest
Bug: b/229801892
Change-Id: I95eb07680fe80cfc3bfafaa2de81c48d61d14b4b
This commit is contained in:
Tim Murray
2022-04-19 17:36:33 -07:00
parent bce81ecc1e
commit 712f48c217

View File

@@ -71,7 +71,7 @@ TEST(WorkerThreadTest, ScheduleReturnsFalseWhenQueueIsFull) {
TEST(WorkerThreadTest, TasksExecuteInOrder) {
constexpr int NUM_TASKS = 10000;
WorkerThread worker(NUM_TASKS);
WorkerThread worker(NUM_TASKS + 1);
std::mutex mut;
std::condition_variable cv;