Skip to content

Commit 10996c5

Browse files
committed
Use majority write concern and remove assert in change stream tests (#1980)
* use majority write concern in change stream test * do not assert that resume token changed after receiving no documents
1 parent 54dea31 commit 10996c5

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/libmongoc/tests/test-mongoc-change-stream.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -353,14 +353,10 @@ test_change_stream_live_track_resume_token (void *test_ctx)
353353
ASSERT (bson_compare (resume_token, &doc1_rt) != 0);
354354
bson_copy_to (resume_token, &doc2_rt);
355355

356-
/* There are no docs left. But the next call should still keep the same
357-
* resume token */
356+
/* There are no docs left. */
358357
ASSERT (!mongoc_change_stream_next (stream, &next_doc));
359358
ASSERT_OR_PRINT (!mongoc_change_stream_error_document (stream, &error, NULL), error);
360359
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);
364360

365361
bson_destroy (&doc0_rt);
366362
bson_destroy (&doc1_rt);
@@ -1169,10 +1165,7 @@ typedef struct {
11691165
bson_t agg_reply;
11701166
} resume_ctx_t;
11711167

1172-
#define RESUME_INITIALIZER \
1173-
{ \
1174-
false, false, BSON_INITIALIZER \
1175-
}
1168+
#define RESUME_INITIALIZER {false, false, BSON_INITIALIZER}
11761169

11771170
static void
11781171
_resume_at_optime_started (const mongoc_apm_command_started_t *event)

0 commit comments

Comments
 (0)