From bd81003cf222ac705ed8cfa476f952d87d5d04ba Mon Sep 17 00:00:00 2001 From: Vincent Do Date: Tue, 17 May 2016 16:11:09 -0400 Subject: SERVER-24070 Make index_delete.js not timing dependent --- src/mongo/db/catalog/index_create.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/mongo/db/catalog/index_create.cpp b/src/mongo/db/catalog/index_create.cpp index b18e90ac880..72c0bc6a28a 100644 --- a/src/mongo/db/catalog/index_create.cpp +++ b/src/mongo/db/catalog/index_create.cpp @@ -62,6 +62,7 @@ using std::string; using std::endl; MONGO_FP_DECLARE(crashAfterStartingIndexBuild); +MONGO_FP_DECLARE(hangAfterStartingIndexBuild); /** * On rollback sets MultiIndexBlock::_needToCleanup to true. @@ -311,6 +312,13 @@ Status MultiIndexBlock::insertAllDocumentsInCollection(std::set* dupsO WorkingSetCommon::toStatusString(objToIndex.value()), state == PlanExecutor::IS_EOF); + // Need the index build to hang before the progress meter is marked as finished so we can + // reliably check that the index build has actually started in js tests. + while (MONGO_FAIL_POINT(hangAfterStartingIndexBuild)) { + log() << "Hanging index build due to 'hangAfterStartingIndexBuild' failpoint"; + sleepmillis(1000); + } + progress->finished(); Status ret = doneInserting(dupsOut); -- cgit v1.2.1