mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
SERVER-46026 index_stepdown_after_init.js tests against stuctured logs
This commit is contained in:
parent
d9498822ad
commit
3d92f8e574
@ -21,7 +21,6 @@ selector:
|
|||||||
- jstests/noPassthrough/loglong.js
|
- jstests/noPassthrough/loglong.js
|
||||||
- jstests/noPassthrough/hybrid_index_with_updates.js
|
- jstests/noPassthrough/hybrid_index_with_updates.js
|
||||||
- jstests/noPassthrough/hybrid_unique_index_with_updates.js
|
- jstests/noPassthrough/hybrid_unique_index_with_updates.js
|
||||||
- jstests/noPassthrough/index_stepdown_after_init.js
|
|
||||||
|
|
||||||
# noPassthrough tests start their own mongod's.
|
# noPassthrough tests start their own mongod's.
|
||||||
executor:
|
executor:
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
load('jstests/noPassthrough/libs/index_build.js');
|
load('jstests/noPassthrough/libs/index_build.js');
|
||||||
|
load("jstests/libs/logv2_helpers.js");
|
||||||
|
|
||||||
const rst = new ReplSetTest({
|
const rst = new ReplSetTest({
|
||||||
nodes: [
|
nodes: [
|
||||||
@ -34,8 +35,15 @@ assert.commandWorked(primary.adminCommand(
|
|||||||
|
|
||||||
const createIdx = IndexBuildTest.startIndexBuild(primary, coll.getFullName(), {a: 1});
|
const createIdx = IndexBuildTest.startIndexBuild(primary, coll.getFullName(), {a: 1});
|
||||||
|
|
||||||
checkLog.contains(
|
if (isJsonLogNoConn()) {
|
||||||
primary, 'index build: starting on ' + coll.getFullName() + ' properties: { v: 2, key: { a:');
|
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 {
|
try {
|
||||||
// Step down the primary.
|
// 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)) {
|
if (!IndexBuildTest.supportsTwoPhaseIndexBuild(primary)) {
|
||||||
// Wait for the IndexBuildCoordinator thread, not the command thread, to report the index build
|
// Wait for the IndexBuildCoordinator thread, not the command thread, to report the index build
|
||||||
// as failed.
|
// 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
|
// Check that no new index has been created. This verifies that the index build was aborted
|
||||||
// rather than successfully completed.
|
// rather than successfully completed.
|
||||||
|
Loading…
Reference in New Issue
Block a user