@@ -177,6 +177,7 @@ TEST_F(DBClientCursorTest, DBClientCursorHandlesOpMsgExhaustCorrectly) {
177177
178178 // Request more results. This call should trigger the first 'getMore' request with exhaust
179179 // flag set.
180+ conn.clearLastSentMessage ();
180181 ASSERT (cursor.more ());
181182 m = conn.getLastSentMessage ();
182183
@@ -240,6 +241,7 @@ TEST_F(DBClientCursorTest, DBClientCursorResendsGetMoreIfMoreToComeFlagIsOmitted
240241
241242 // Request more results. This call should trigger the first 'getMore' request with exhaust
242243 // flag set.
244+ conn.clearLastSentMessage ();
243245 ASSERT (cursor.more ());
244246 m = conn.getLastSentMessage ();
245247 ASSERT (!m.empty ());
@@ -262,6 +264,7 @@ TEST_F(DBClientCursorTest, DBClientCursorResendsGetMoreIfMoreToComeFlagIsOmitted
262264 // Request more results again. This call should trigger another 'getMore' request, since the
263265 // previous response had no 'moreToCome' flag set. This time the mock server will respond with
264266 // the 'moreToCome' flag set.
267+ conn.clearLastSentMessage ();
265268 ASSERT (cursor.more ());
266269 m = conn.getLastSentMessage ();
267270 ASSERT (!m.empty ());
@@ -280,6 +283,7 @@ TEST_F(DBClientCursorTest, DBClientCursorResendsGetMoreIfMoreToComeFlagIsOmitted
280283 conn.setRecvResponse (terminalGetMoreResponseMsg);
281284
282285 // Get the last returned document.
286+ conn.clearLastSentMessage ();
283287 ASSERT (cursor.more ());
284288 ASSERT_BSONOBJ_EQ (terminalDoc, cursor.next ());
285289
0 commit comments