Skip to content

Commit 9d16c1a

Browse files
don't check change stream error for latest server version
1 parent a47d105 commit 9d16c1a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/libmongoc/tests/test-libmongoc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,6 +2168,7 @@ WIRE_VERSION_CHECKS (4)
21682168
WIRE_VERSION_CHECKS (5)
21692169
WIRE_VERSION_CHECKS (6)
21702170
WIRE_VERSION_CHECKS (7)
2171+
WIRE_VERSION_CHECKS (8)
21712172

21722173
int
21732174
test_framework_skip_if_no_dual_ip_hostname (void)

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,14 @@ test_change_stream_live_missing_resume_token (void *test_ctx)
530530

531531
ASSERT (!mongoc_change_stream_next (stream, &next_doc));
532532
ASSERT (mongoc_change_stream_error_document (stream, &err, NULL));
533-
ASSERT_ERROR_CONTAINS (err,
534-
MONGOC_ERROR_CURSOR,
535-
MONGOC_ERROR_CHANGE_STREAM_NO_RESUME_TOKEN,
536-
"Cannot provide resume functionality");
533+
534+
/* Newer server versions emit different errors. */
535+
if (!test_framework_max_wire_version_at_least (8)) {
536+
ASSERT_ERROR_CONTAINS (err,
537+
MONGOC_ERROR_CURSOR,
538+
MONGOC_ERROR_CHANGE_STREAM_NO_RESUME_TOKEN,
539+
"Cannot provide resume functionality");
540+
}
537541

538542
bson_destroy (&opts);
539543
mongoc_write_concern_destroy (wc);

0 commit comments

Comments
 (0)