diff options
author | Bernard Gorman <bernard.gorman@gmail.com> | 2017-01-17 20:47:21 +0000 |
---|---|---|
committer | James Wahlin <james.wahlin@10gen.com> | 2017-01-18 12:08:17 -0500 |
commit | e8893fc311ac12028dafcf4416c2f534a42f1cf7 (patch) | |
tree | 5edfe869a5f36db525872bcdc049b39d724f7e19 /jstests/libs/profiler.js | |
parent | 2ff3efcabb0a43d5d21b3d636caa76efa4df8bd3 (diff) | |
download | mongo-e8893fc311ac12028dafcf4416c2f534a42f1cf7.tar.gz |
SERVER-27438 Prevent mongos from dropping legacy $comment meta-operator
Closes #1135
Signed-off-by: James Wahlin <james.wahlin@10gen.com>
Diffstat (limited to 'jstests/libs/profiler.js')
-rw-r--r-- | jstests/libs/profiler.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/jstests/libs/profiler.js b/jstests/libs/profiler.js index b7c4a3f89e7..c0fc210c928 100644 --- a/jstests/libs/profiler.js +++ b/jstests/libs/profiler.js @@ -14,4 +14,13 @@ function getProfilerProtocolStringForCommand(conn) { } return "op_command"; +} + +// Throws an assertion if the profiler does not contain exactly one entry matching <filter>. +// Optional arguments <errorMsgFilter> and <errorMsgProj> limit profiler output if this asserts. +function profilerHasSingleMatchingEntryOrThrow(inputDb, filter, errorMsgFilter, errorMsgProj) { + assert.eq(inputDb.system.profile.find(filter).itcount(), + 1, + "Expected exactly one op matching: " + tojson(filter) + " in profiler " + + tojson(inputDb.system.profile.find(errorMsgFilter, errorMsgProj).toArray())); }
\ No newline at end of file |