summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/index_stepdown_after_init.js
diff options
context:
space:
mode:
authorGabriel Russell <gabriel.russell@mongodb.com>2020-02-19 14:08:02 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-19 22:09:48 +0000
commit3d92f8e5740486196b69a1c9eb662bde3ad535d3 (patch)
treeca008eb70bfa7c77ec0d8f50d37e7dc47d6222d0 /jstests/noPassthrough/index_stepdown_after_init.js
parentd9498822ada47c6de872ba5452500ec6ac1815b5 (diff)
downloadmongo-3d92f8e5740486196b69a1c9eb662bde3ad535d3.tar.gz
SERVER-46026 index_stepdown_after_init.js tests against stuctured logs
Diffstat (limited to 'jstests/noPassthrough/index_stepdown_after_init.js')
-rw-r--r--jstests/noPassthrough/index_stepdown_after_init.js19
1 files changed, 16 insertions, 3 deletions
diff --git a/jstests/noPassthrough/index_stepdown_after_init.js b/jstests/noPassthrough/index_stepdown_after_init.js
index f1f4f63b5eb..2d2c4b96e46 100644
--- a/jstests/noPassthrough/index_stepdown_after_init.js
+++ b/jstests/noPassthrough/index_stepdown_after_init.js
@@ -7,6 +7,7 @@
"use strict";
load('jstests/noPassthrough/libs/index_build.js');
+load("jstests/libs/logv2_helpers.js");
const rst = new ReplSetTest({
nodes: [
@@ -34,8 +35,15 @@ assert.commandWorked(primary.adminCommand(
const createIdx = IndexBuildTest.startIndexBuild(primary, coll.getFullName(), {a: 1});
-checkLog.contains(
- primary, 'index build: starting on ' + coll.getFullName() + ' properties: { v: 2, key: { a:');
+if (isJsonLogNoConn()) {
+ checkLog.contains(
+ primary,
+ /\"index build: starting on {ns} properties: {descriptor} using method: {method}\".*\"descriptor\":\"{ v: 2, key: { a:/);
+} else {
+ checkLog.contains(
+ primary,
+ 'index build: starting on ' + coll.getFullName() + ' properties: { v: 2, key: { a:');
+}
try {
// Step down the primary.
@@ -54,7 +62,12 @@ assert.neq(0, exitCode, 'expected shell to exit abnormally due to index build be
if (!IndexBuildTest.supportsTwoPhaseIndexBuild(primary)) {
// Wait for the IndexBuildCoordinator thread, not the command thread, to report the index build
// as failed.
- checkLog.contains(primary, '[IndexBuildsCoordinatorMongod-0] Index build failed: ');
+ if (isJsonLogNoConn()) {
+ checkLog.contains(
+ primary, "\"ctx\":\"IndexBuildsCoordinatorMongod-0\",\"msg\":\"Index build failed");
+ } else {
+ checkLog.contains(primary, '[IndexBuildsCoordinatorMongod-0] Index build failed: ');
+ }
// Check that no new index has been created. This verifies that the index build was aborted
// rather than successfully completed.