jstests/noPassthrough/libs/index_build.js
/**
     * Generates the fail point data and appends it to the 'data' field of each element in
     * 'failPoints'. Returns the build UUIDs of the index builds on the given collection.
     */
Generates the fail point data and appends it to the 'data' field of each element in
'failPoints'. Returns the build UUIDs of the index builds on the given collection.
Generates the fail point data and appends it to the ' data ' field of each element in ' failPoints ' . Returns the build UUIDs of the index builds on the given collection .
static generateFailPointsData(coll, failPoints, failPointsIteration, indexNames) {
        const indexNamesFlat = ResumableIndexBuildTest.flatten(indexNames);
        const indexNamesFlatSinglePerBuild = new Array(indexNames.length);
        const buildUUIDs = new Array(indexNames.length);
        for (let i = 0; i < indexNames.length; i++) {
            indexNamesFlatSinglePerBuild[i] = indexNames[i][0];
            buildUUIDs[i] = extractUUIDFromObject(
                IndexBuildTest
                    .assertIndexesIdHelper(coll, indexNamesFlat.length, [], indexNamesFlat, {
                        includeBuildUUIDs: true
                    })[indexNames[i][0]]
                    .buildUUID);
        }
        for (let i = 0; i < failPoints.length; i++) {
            const data = {
                buildUUIDs: failPoints.length === 1 ? buildUUIDs : [buildUUIDs[i]],
                indexNames: failPoints.length === 1 ? indexNamesFlatSinglePerBuild
                                                    : [indexNames[i][0]],
                iteration: failPointsIteration
            };
            if (failPoints[i].data) {
                failPoints[i].data.buildUUIDs =
                    failPoints[i].data.buildUUIDs.concat(data.buildUUIDs);
                failPoints[i].data.indexNames =
                    failPoints[i].data.indexNames.concat(data.indexNames);
            } else {
                failPoints[i].data = data;
            }
        }
        return buildUUIDs;
    }
static generateFailPointsData ( coll , failPoints , failPointsIteration , indexNames ) { const indexNamesFlat = ResumableIndexBuildTest . flatten ( indexNames ) ; const indexNamesFlatSinglePerBuild = new Array ( indexNames . length ) ; const buildUUIDs = new Array ( indexNames . length ) ; for ( let i = 0 ; i < indexNames . length ; i ++ ) { indexNamesFlatSinglePerBuild [ i ] = indexNames [ i ] [ 0 ] ; buildUUIDs [ i ] = extractUUIDFromObject ( IndexBuildTest . assertIndexesIdHelper ( coll , indexNamesFlat . length , [ ] , indexNamesFlat , { includeBuildUUIDs : true } ) [ indexNames [ i ] [ 0 ] ] . buildUUID ) ; } for ( let i = 0 ; i < failPoints . length ; i ++ ) { const data = { buildUUIDs : failPoints . length === 1 ? buildUUIDs : [ buildUUIDs [ i ] ] , indexNames : failPoints . length === 1 ? indexNamesFlatSinglePerBuild : [ indexNames [ i ] [ 0 ] ] , iteration : failPointsIteration } ; if ( failPoints [ i ] . data ) { failPoints [ i ] . data . buildUUIDs = failPoints [ i ] . data . buildUUIDs . concat ( data . buildUUIDs ) ; failPoints [ i ] . data . indexNames = failPoints [ i ] . data . indexNames . concat ( data . indexNames ) ; } else { failPoints [ i ] . data = data ; } } return buildUUIDs ; }
Generates the fail point data and appends it to the 'data' field of each element in
 'failPoints'.
Generates the fail point data and appends it to the ' data ' field of each element in ' failPoints ' .
// If there is only one failpoint, its data must include all build UUIDs and index names. // Otherwise, each failpoint should only have its respective build UUID and index name(s).