Skip to content

Commit a48e71a

Browse files
authored
remove test /change_stream/live/single_server (#2144)
The error message changed in latest servers causing test failures. Appears redundant with a JSON test "The watch helper must not throw a custom exception ..." which checks for an error code.
1 parent 68593f9 commit a48e71a

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

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

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -191,53 +191,6 @@ test_change_stream_pipeline(void)
191191
mock_server_destroy(server);
192192
}
193193

194-
/* From Change Streams Spec tests:
195-
* "The watch helper must not throw a custom exception when executed against a
196-
* single server topology, but instead depend on a server error"
197-
*/
198-
static void
199-
test_change_stream_live_single_server(void *test_ctx)
200-
{
201-
/* Temporarily skip on arm64 until mongod tested against is updated */
202-
mongoc_client_t *client = test_framework_new_default_client();
203-
mongoc_collection_t *coll;
204-
bson_error_t error;
205-
mongoc_change_stream_t *stream;
206-
const bson_t *next_doc = NULL;
207-
const bson_t *reported_err_doc = NULL;
208-
const char *not_replset_doc = "{'errmsg': 'The $changeStream stage is "
209-
"only supported on replica sets', 'code': "
210-
"40573, 'ok': 0}";
211-
212-
/* Don't use the errmsg field since it contains quotes. */
213-
const char *not_supported_doc = "{'code' : 40324, 'ok' : 0 }";
214-
215-
BSON_UNUSED(test_ctx);
216-
217-
ASSERT(client);
218-
219-
coll = mongoc_client_get_collection(client, "db", "coll");
220-
ASSERT(coll);
221-
ASSERT_OR_PRINT(mongoc_collection_insert_one(coll, tmp_bson(NULL), NULL, NULL, &error), error);
222-
223-
stream = mongoc_collection_watch(coll, tmp_bson("{}"), NULL);
224-
ASSERT(stream);
225-
226-
ASSERT(mongoc_change_stream_error_document(stream, NULL, &reported_err_doc));
227-
ASSERT(next_doc == NULL);
228-
229-
if (test_framework_max_wire_version_at_least(6)) {
230-
ASSERT_MATCH(reported_err_doc, not_replset_doc);
231-
} else {
232-
ASSERT_MATCH(reported_err_doc, not_supported_doc);
233-
ASSERT_CONTAINS(bson_lookup_utf8(reported_err_doc, "errmsg"), "Unrecognized pipeline stage");
234-
}
235-
236-
mongoc_change_stream_destroy(stream);
237-
mongoc_client_destroy(client);
238-
mongoc_collection_destroy(coll);
239-
}
240-
241194

242195
typedef struct _test_resume_token_ctx_t {
243196
bool expecting_resume_token;
@@ -2134,13 +2087,6 @@ test_change_stream_install(TestSuite *suite)
21342087
{
21352088
TestSuite_AddMockServerTest(suite, "/change_stream/pipeline", test_change_stream_pipeline);
21362089

2137-
TestSuite_AddFull(suite,
2138-
"/change_stream/live/single_server",
2139-
test_change_stream_live_single_server,
2140-
NULL,
2141-
NULL,
2142-
test_framework_skip_if_not_single);
2143-
21442090
TestSuite_AddFull(suite,
21452091
"/change_stream/live/track_resume_token",
21462092
test_change_stream_live_track_resume_token,

0 commit comments

Comments
 (0)