@@ -308,6 +308,9 @@ test_change_stream_live_track_resume_token (void *test_ctx)
308
308
309
309
coll = drop_and_get_coll (client , "db" , "coll_resume" );
310
310
ASSERT (coll );
311
+ ASSERT_OR_PRINT (
312
+ mongoc_collection_insert_one (coll , tmp_bson (NULL ), NULL , NULL , & error ),
313
+ error );
311
314
312
315
/* Set the batch size to 1 so we only get one document per call to next. */
313
316
stream = mongoc_collection_watch (
@@ -439,6 +442,9 @@ test_change_stream_live_batch_size (void *test_ctx)
439
442
440
443
coll = drop_and_get_coll (client , "db" , "coll_batch" );
441
444
ASSERT (coll );
445
+ ASSERT_OR_PRINT (
446
+ mongoc_collection_insert_one (coll , tmp_bson (NULL ), NULL , NULL , & err ),
447
+ err );
442
448
443
449
stream = mongoc_collection_watch (
444
450
coll , tmp_bson ("{}" ), tmp_bson ("{'batchSize': 1}" ));
@@ -505,6 +511,9 @@ test_change_stream_live_missing_resume_token (void *test_ctx)
505
511
506
512
coll = drop_and_get_coll (client , "db" , "coll_missing_resume" );
507
513
ASSERT (coll );
514
+ ASSERT_OR_PRINT (
515
+ mongoc_collection_insert_one (coll , tmp_bson (NULL ), NULL , NULL , & err ),
516
+ err );
508
517
509
518
stream = mongoc_collection_watch (
510
519
coll , tmp_bson ("{'pipeline': [{'$project': {'_id': 0 }}]}" ), NULL );
@@ -883,6 +892,9 @@ test_change_stream_live_watch (void *test_ctx)
883
892
884
893
coll = drop_and_get_coll (client , "db" , "coll_watch" );
885
894
ASSERT (coll );
895
+ ASSERT_OR_PRINT (
896
+ mongoc_collection_insert_one (coll , tmp_bson (NULL ), NULL , NULL , & err ),
897
+ err );
886
898
887
899
stream = mongoc_collection_watch (coll , tmp_bson ("{}" ), NULL );
888
900
ASSERT (stream );
@@ -965,6 +977,9 @@ test_change_stream_live_read_prefs (void *test_ctx)
965
977
966
978
coll = drop_and_get_coll (client , "db" , "coll_read_prefs" );
967
979
ASSERT (coll );
980
+ ASSERT_OR_PRINT (
981
+ mongoc_collection_insert_one (coll , tmp_bson (NULL ), NULL , NULL , & err ),
982
+ err );
968
983
969
984
prefs = mongoc_read_prefs_copy (mongoc_collection_get_read_prefs (coll ));
970
985
mongoc_read_prefs_set_mode (prefs , MONGOC_READ_SECONDARY );
0 commit comments