jstests/noPassthrough/libs/index_build.js
/**
     * Disables the fail points specified by 'failPointsToDisable' and then waits for the fail
     * points specified by 'failPoints' to be reached.
     */
Disables the fail points specified by 'failPointsToDisable' and then waits for the fail
points specified by 'failPoints' to be reached.
Disables the fail points specified by ' failPointsToDisable ' and then waits for the fail points specified by ' failPoints ' to be reached .
static waitForFailPoints(conn, failPointsToDisable, failPoints, failPointForSingleIndexBuild) {
        assert.commandWorked(conn.adminCommand({clearLog: "global"}));
        for (const fp of failPointsToDisable) {
            assert.commandWorked(conn.adminCommand({configureFailPoint: fp, mode: "off"}));
        }
        for (const failPoint of failPoints) {
            if (failPoint.logIdWithBuildUUID) {
                for (const buildUUID of failPoint.data.buildUUIDs) {
                    checkLog.containsJson(conn, failPoint.logIdWithBuildUUID, {
                        buildUUID: function(uuid) {
                            return uuid["uuid"]["$uuid"] === buildUUID;
                        }
                    });
                }
            } else if (failPoint.logIdWithIndexName) {
                for (const indexName of failPoint.data.indexNames) {
                    checkLog.containsJson(conn, failPoint.logIdWithIndexName, {index: indexName});
                }
            } else if (failPoint.useWaitForFailPointForSingleIndexBuild) {
                assert.eq(
                    failPoints.length,
                    1,
                    "Can only use useWaitForFailPointForSingleIndexBuild with a single index build");
                failPointForSingleIndexBuild.wait();
            } else {
                assert(false,
                       "Must specify one of logIdWithBuildUUID, logIdWithIndexName, and " +
                           "useWaitForFailPointForSingleIndexBuild");
            }
        }
    }
static waitForFailPoints ( conn , failPointsToDisable , failPoints , failPointForSingleIndexBuild ) { assert . commandWorked ( conn . adminCommand ( { clearLog : "global" } ) ) ; for ( const fp of failPointsToDisable ) { assert . commandWorked ( conn . adminCommand ( { configureFailPoint : fp , mode : "off" } ) ) ; } for ( const failPoint of failPoints ) { if ( failPoint . logIdWithBuildUUID ) { for ( const buildUUID of failPoint . data . buildUUIDs ) { checkLog . containsJson ( conn , failPoint . logIdWithBuildUUID , { buildUUID : function ( uuid ) { return uuid [ "uuid" ] [ "$uuid" ] === buildUUID ; } } ) ; } } else if ( failPoint . logIdWithIndexName ) { for ( const indexName of failPoint . data . indexNames ) { checkLog . containsJson ( conn , failPoint . logIdWithIndexName , { index : indexName } ) ; } } else if ( failPoint . useWaitForFailPointForSingleIndexBuild ) { assert . eq ( failPoints . length , 1 , "Can only use useWaitForFailPointForSingleIndexBuild with a single index build" ) ; failPointForSingleIndexBuild . wait ( ) ; } else { assert ( false , "Must specify one of logIdWithBuildUUID, logIdWithIndexName, and " + "useWaitForFailPointForSingleIndexBuild" ) ; } } }
Disables the fail points specified by 'failPointsToDisable' and then waits for the fail
 points specified by 'failPoints' to be reached.
Disables the fail points specified by ' failPointsToDisable ' and then waits for the fail points specified by ' failPoints ' to be reached .
// Wait for the index builds to reach their respective failpoints.