diff options
Diffstat (limited to 'jstests/noPassthrough/index_stepdown_after_init.js')
-rw-r--r-- | jstests/noPassthrough/index_stepdown_after_init.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/jstests/noPassthrough/index_stepdown_after_init.js b/jstests/noPassthrough/index_stepdown_after_init.js index 0b5eccc27d8..c27df900ce0 100644 --- a/jstests/noPassthrough/index_stepdown_after_init.js +++ b/jstests/noPassthrough/index_stepdown_after_init.js @@ -59,13 +59,18 @@ {configureFailPoint: 'hangAfterInitializingIndexBuild', mode: 'off'})); } + // Wait for the index build to stop. + IndexBuildTest.waitForIndexBuildToStop(testDB); + const exitCode = createIdx({checkExitSuccess: false}); assert.neq( 0, exitCode, 'expected shell to exit abnormally due to index build being terminated'); - rst.stop(primary, undefined, {allowedExitCode: MongoRunner.EXIT_ABORT}); - assert(rawMongoProgramOutput().match('Fatal assertion 51101 IndexBuildAborted: Index build: '), - 'Index build should have aborted on step down.'); + checkLog.contains(primary, 'IndexBuildAborted: Index build aborted: '); + + // Check that no new index has been created. This verifies that the index build was aborted + // rather than successfully completed. + IndexBuildTest.assertIndexes(coll, 1, ['_id_']); rst.stopSet(); })(); |