Skip to content

Commit cea8aee

Browse files
author
Daniel Gottlieb
committed
SERVER-42514: Have text_index_limits.js first replicate the index build before proceeding.
Also move the test into jstests/replsets so a ReplSetTest object is available for doing the waiting.
1 parent fa973c9 commit cea8aee

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

jstests/core/text_index_limits.js renamed to jstests/replsets/text_index_limits.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@
88
(function() {
99
"use strict";
1010

11+
const replTest = new ReplSetTest({nodes: 3});
12+
replTest.startSet();
13+
replTest.initiate();
14+
15+
const db = replTest.getPrimary().getDB("test");
1116
var t = db.text_index_limits;
1217
t.drop();
1318

1419
assert.commandWorked(t.createIndex({comments: "text"}));
20+
replTest.waitForAllIndexBuildsToFinish(t.getDB(), t.getName());
1521

1622
// 1. Test number of unique terms exceeds 400,000
1723
let commentsWithALotOfUniqueWords = "";
@@ -42,6 +48,9 @@ for (let ch1 = 97; ch1 < 123; ch1++) {
4248
}
4349
}
4450
}
51+
4552
assert.commandWorked(db.runCommand(
4653
{insert: t.getName(), documents: [{_id: 2, comments: commentsWithWordsOfLargeSize}]}));
47-
}());
54+
55+
replTest.stopSet();
56+
})();

0 commit comments

Comments
 (0)