summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2023-02-14 15:32:28 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-14 18:53:23 +0000
commit75ff482b93060c1c8a28f418dc55d16c4fcc02b6 (patch)
tree27953985210b689fffb0acb19a9f78fbd1053a24
parent496b02cbf35396ec1571eac3aa66e369bebf4188 (diff)
downloadmongo-75ff482b93060c1c8a28f418dc55d16c4fcc02b6.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.
-rw-r--r--jstests/sharding/libs/resharding_test_fixture.js17
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 d4820f592c6..283f6a91039 100644
--- a/jstests/sharding/libs/resharding_test_fixture.js
+++ b/jstests/sharding/libs/resharding_test_fixture.js
@@ -515,7 +515,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.
@@ -524,9 +526,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,