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.
This commit is contained in:
Max Hirschhorn 2023-02-14 15:32:28 +00:00 committed by Evergreen Agent
parent 496b02cbf3
commit 75ff482b93

View File

@ -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,