Skip to content

Commit 538904b

Browse files
BenHuddlestondaverigby
authored andcommitted
MB-51558: Fix ScheduleCancelx2 intermittent failure
We occasionally see this test fail for the CB3 pool because registerTaskable() also starts up n workers which are actually running during this test. This test assumes 0 running workers to poke the state properly so we should move the setting of NonIO threads to 0 to after the registerTaskable call. Change-Id: Ie3b5f1ed93182c67eb288789c23e14c7962ba133 Reviewed-on: https://review.couchbase.org/c/kv_engine/+/172612 Reviewed-by: Dave Rigby <[email protected]> Tested-by: Build Bot <[email protected]>
1 parent 3a63f5e commit 538904b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

engines/ep/tests/module_tests/executorpool_test.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,10 +706,13 @@ TYPED_TEST(ExecutorPoolTest, ScheduleCancelx2) {
706706
// (Note: makePool assumes '0' means "auto-configure" for thread counts,
707707
// hence must make explicit call to setNonIO(0) after construction.)
708708
this->makePool(1, 1, 1, 1);
709-
this->pool->setNumNonIO(0);
710709
NiceMock<MockTaskable> taskable;
711710
this->pool->registerTaskable(taskable);
712711

712+
// registerTaskable also starts workers for the CB3 pool so we must set our
713+
// workers back to 0 after.
714+
this->pool->setNumNonIO(0);
715+
713716
// Setup - simple test task which does nothing.
714717
// 1 hour - i.e. we don't want it to run when initially scheduled.
715718
auto sleepTime = 60.0 * 60.0;

0 commit comments

Comments
 (0)