summaryrefslogtreecommitdiff
path: root/jstests/sharding/libs
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2020-02-17 22:40:59 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-18 04:03:33 +0000
commit811b695a37c8c1469b4f6475e62c9a6680b3d95f (patch)
tree37eba8845a07d2904bc6ca292a1ea31475a1168a /jstests/sharding/libs
parent95c8fc6a4a98f70b07f32565e3ef3e48172efa1e (diff)
downloadmongo-811b695a37c8c1469b4f6475e62c9a6680b3d95f.tar.gz
SERVER-46026 Fix tests reliant on specific log lines
Diffstat (limited to 'jstests/sharding/libs')
-rw-r--r--jstests/sharding/libs/sharded_transactions_helpers.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/jstests/sharding/libs/sharded_transactions_helpers.js b/jstests/sharding/libs/sharded_transactions_helpers.js
index 0fdd971a834..38579460dce 100644
--- a/jstests/sharding/libs/sharded_transactions_helpers.js
+++ b/jstests/sharding/libs/sharded_transactions_helpers.js
@@ -1,3 +1,5 @@
+load("jstests/libs/logv2_helpers.js");
+
const kSnapshotErrors =
[ErrorCodes.SnapshotTooOld, ErrorCodes.SnapshotUnavailable, ErrorCodes.StaleChunkHistory];
@@ -97,6 +99,17 @@ function assertNoSuchTransactionOnConn(conn, lsid, txnNumber) {
function waitForFailpoint(hitFailpointStr, numTimes, timeout) {
// Don't run the hang analyzer because we don't expect waitForFailpoint() to always succeed.
+ if (isJsonLogNoConn()) {
+ const hitFailpointRe = /Hit (\w+) failpoint/;
+ const hitRe = /Hit (\w+)/;
+ const matchHitFailpoint = hitFailpointStr.match(hitFailpointRe);
+ const matchHit = hitFailpointStr.match(hitRe);
+ if (matchHitFailpoint) {
+ hitFailpointStr = `(Hit .+ failpoint.*${matchHitFailpoint[1]}|${hitFailpointStr})`;
+ } else {
+ hitFailpointStr = `(Hit .+.*${matchHit[1]}|${hitFailpointStr})`;
+ }
+ }
assert.soon(
function() {
const re = new RegExp(hitFailpointStr, 'g' /* find all occurrences */);