diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2023-02-15 21:30:50 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-15 21:56:48 +0000 |
commit | 1b7dd95a8f205c7daa2034790b2e973f3542b4a0 (patch) | |
tree | e0ceaa06a00ee84801d968949c33b6ae1a35ad47 | |
parent | b3e66917010a239a29a40453018bcfc4cdc82c0f (diff) | |
download | mongo-1b7dd95a8f205c7daa2034790b2e973f3542b4a0.tar.gz |
SERVER-73916 Improve error in ReshardingTest on failpoint not reached.
Enables the ReshardingTest fixture to use the
reshardingPauseCoordinatorBeforeCompletion failpoint being hit earlier
than expected as an indication the other resharding-related failpoints
won't ever be reached.
(cherry picked from commit 75ff482b93060c1c8a28f418dc55d16c4fcc02b6)
-rw-r--r-- | jstests/sharding/libs/resharding_test_fixture.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/jstests/sharding/libs/resharding_test_fixture.js b/jstests/sharding/libs/resharding_test_fixture.js index 6e918c9e07f..c4f09be2dfd 100644 --- a/jstests/sharding/libs/resharding_test_fixture.js +++ b/jstests/sharding/libs/resharding_test_fixture.js @@ -486,7 +486,9 @@ var ReshardingTest = class { * proceeding to the next stage. This helper returns after either: * * 1) The node's waitForFailPoint returns successfully or - * 2) The `reshardCollection` command has returned a response. + * 2) The `reshardCollection` command has returned a response or + * 3) The ReshardingCoordinator is blocked on the reshardingPauseCoordinatorBeforeCompletion + * failpoint and won't ever satisfy the supplied failpoint. * * The function returns true when we returned because the server reached the failpoint. The * function returns false when the `reshardCollection` command is no longer running. @@ -495,9 +497,20 @@ var ReshardingTest = class { * @private */ _waitForFailPoint(fp) { + const completionFailpoint = this._pauseCoordinatorBeforeCompletionFailpoints.find( + completionFailpoint => completionFailpoint.conn.host === fp.conn.host); + assert.soon( () => { - return this._commandDoneSignal.getCount() === 0 || fp.waitWithTimeout(1000); + if (this._commandDoneSignal.getCount() === 0 || fp.waitWithTimeout(1000)) { + return true; + } + + if (completionFailpoint !== fp && completionFailpoint.waitWithTimeout(1000)) { + completionFailpoint.off(); + } + + return false; }, "Timed out waiting for failpoint to be hit. Failpoint: " + fp.failPointName, undefined, |