jstests/noPassthrough/libs/index_build.js
/**
     * Makes sure that inserting into a collection outside of an index build works properly,
     * validates indexes on all nodes in the replica set, and drops the index at the end.
     */
Makes sure that inserting into a collection outside of an index build works properly,
validates indexes on all nodes in the replica set, and drops the index at the end.
Makes sure that inserting into a collection outside of an index build works properly validates indexes on all nodes in the replica set and drops the index at the end .
static checkIndexes(test, dbName, collName, indexNames, postIndexBuildInserts) {
        const primary = test.getPrimary();
        const coll = primary.getDB(dbName).getCollection(collName);
        test.awaitReplication();
        assert.commandWorked(coll.insert(postIndexBuildInserts));
        for (const node of test.nodes ? test.nodes : test.getTestFixture().nodes) {
            const res = node.getDB(dbName).getCollection(collName).validate();
            assert(res.valid, "Index validation failed: " + tojson(res));
        }
        for (const names of indexNames) {
            assert.commandWorked(coll.dropIndexes(names));
        }
    }
static checkIndexes ( test , dbName , collName , indexNames , postIndexBuildInserts ) { const primary = test . getPrimary ( ) ; const coll = primary . getDB ( dbName ) . getCollection ( collName ) ; test . awaitReplication ( ) ; assert . commandWorked ( coll . insert ( postIndexBuildInserts ) ) ; for ( const node of test . nodes ? test . nodes : test . getTestFixture ( ) . nodes ) { const res = node . getDB ( dbName ) . getCollection ( collName ) . validate ( ) ; assert ( res . valid , "Index validation failed: " + tojson ( res ) ) ; } for ( const names of indexNames ) { assert . commandWorked ( coll . dropIndexes ( names ) ) ; } }
Makes sure that inserting into a collection outside of an index build works properly,
 validates indexes on all nodes in the replica set, and drops the index at the end.
Makes sure that inserting into a collection outside of an index build works properly validates indexes on all nodes in the replica set and drops the index at the end .