@@ -353,14 +353,10 @@ test_change_stream_live_track_resume_token (void *test_ctx)
353
353
ASSERT (bson_compare (resume_token , & doc1_rt ) != 0 );
354
354
bson_copy_to (resume_token , & doc2_rt );
355
355
356
- /* There are no docs left. But the next call should still keep the same
357
- * resume token */
356
+ /* There are no docs left. */
358
357
ASSERT (!mongoc_change_stream_next (stream , & next_doc ));
359
358
ASSERT_OR_PRINT (!mongoc_change_stream_error_document (stream , & error , NULL ), error );
360
359
ASSERT (!next_doc );
361
- resume_token = mongoc_change_stream_get_resume_token (stream );
362
- ASSERT (!bson_empty0 (resume_token ));
363
- ASSERT (bson_compare (resume_token , & doc2_rt ) == 0 );
364
360
365
361
bson_destroy (& doc0_rt );
366
362
bson_destroy (& doc1_rt );
@@ -2160,6 +2156,13 @@ test_change_stream_batchSize0 (void *test_ctx)
2160
2156
{
2161
2157
mongoc_client_t * client = test_framework_new_default_client ();
2162
2158
mongoc_collection_t * coll = drop_and_get_coll (client , "db" , "coll" );
2159
+ // Insert with majority write concern to ensure documents are visible to change stream.
2160
+ {
2161
+ mongoc_write_concern_t * wc = mongoc_write_concern_new ();
2162
+ mongoc_write_concern_set_w (wc , MONGOC_WRITE_CONCERN_W_MAJORITY );
2163
+ mongoc_collection_set_write_concern (coll , wc );
2164
+ mongoc_write_concern_destroy (wc );
2165
+ }
2163
2166
mongoc_change_stream_t * cs = mongoc_collection_watch (coll , tmp_bson ("{}" ), NULL );
2164
2167
resumeToken = bson_copy (mongoc_change_stream_get_resume_token (cs ));
2165
2168
// Insert documents to create future events.
0 commit comments