jstests/noPassthrough/libs/index_build.js
/**
     * Runs the createIndexes command with the given index specs and corresponding index names and
     * expects it to fail with InterruptedDueToReplStateChange.
     */
Runs the createIndexes command with the given index specs and corresponding index names and
expects it to fail with InterruptedDueToReplStateChange.
Runs the createIndexes command with the given index specs and corresponding index names and expects it to fail with InterruptedDueToReplStateChange .
static createIndexesFails(db, collName, indexSpecs, indexNames) {
        const indexes = new Array(indexSpecs.length);
        for (let i = 0; i < indexSpecs.length; i++) {
            indexes[i] = {key: indexSpecs[i], name: indexNames[i]};
        }
        assert.commandFailedWithCode(db.runCommand({createIndexes: collName, indexes: indexes}),
                                     ErrorCodes.InterruptedDueToReplStateChange);
    }
static createIndexesFails ( db , collName , indexSpecs , indexNames ) { const indexes = new Array ( indexSpecs . length ) ; for ( let i = 0 ; i < indexSpecs . length ; i ++ ) { indexes [ i ] = { key : indexSpecs [ i ] , name : indexNames [ i ] } ; } assert . commandFailedWithCode ( db . runCommand ( { createIndexes : collName , indexes : indexes } ) , ErrorCodes . InterruptedDueToReplStateChange ) ; }
Runs the createIndexes command with the given index specs and corresponding index names and
 expects it to fail with InterruptedDueToReplStateChange.
Runs the createIndexes command with the given index specs and corresponding index names and expects it to fail with InterruptedDueToReplStateChange .