summaryrefslogtreecommitdiff
path: root/jstests/libs/profiler.js
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2017-07-18 11:42:08 -0400
committerEsha Maharishi <esha.maharishi@mongodb.com>2017-07-20 15:39:33 -0400
commitdcc1f2d36eaad6b34355177147e0b2f498531e02 (patch)
treed4f80cc2ecdb28a308894cc57def711ada189ac6 /jstests/libs/profiler.js
parentc95d6c25f5d6b2b6dd8cff5253821c1624cfa767 (diff)
downloadmongo-dcc1f2d36eaad6b34355177147e0b2f498531e02.tar.gz
SERVER-30068 add safe secondary reads targeted integration tests
Diffstat (limited to 'jstests/libs/profiler.js')
-rw-r--r--jstests/libs/profiler.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/jstests/libs/profiler.js b/jstests/libs/profiler.js
index 593836b127c..e8282fecba6 100644
--- a/jstests/libs/profiler.js
+++ b/jstests/libs/profiler.js
@@ -42,3 +42,12 @@ function profilerHasMatchingEntryOrThrow(inputDb, filter, errorMsgFilter, errorM
"Expected at least one op matching: " + tojson(filter) + " in profiler " +
tojson(inputDb.system.profile.find(errorMsgFilter, errorMsgProj).toArray()));
}
+
+// Throws an assertion if the profiler contains an entry matching <filter>.
+// Optional arguments <errorMsgFilter> and <errorMsgProj> limit profiler output if this asserts.
+function profilerDoesNotHaveMatchingEntryOrThrow(inputDb, filter, errorMsgFilter, errorMsgProj) {
+ assert.eq(inputDb.system.profile.find(filter).itcount(),
+ 0,
+ "Expected no ops matching: " + tojson(filter) + " in profiler " +
+ tojson(inputDb.system.profile.find(errorMsgFilter, errorMsgProj).toArray()));
+}