From 0eeb9396ff46269c2181e5d4aeab629863d875d4 Mon Sep 17 00:00:00 2001 From: Bernard Gorman Date: Tue, 17 Jan 2017 20:47:21 +0000 Subject: SERVER-27438 Prevent mongos from dropping legacy $comment meta-operator Closes #1135 Signed-off-by: James Wahlin --- jstests/libs/profiler.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'jstests/libs/profiler.js') 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 . +// Optional arguments and 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 -- cgit v1.2.1