Skip to content

Commit 8cca089

Browse files
committed
use appName to isolate failpoint
1 parent 24c6f63 commit 8cca089

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/libmongoc/tests/test-mongoc-bulk.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4969,6 +4969,7 @@ test_bulk_write_multiple_errors (void *unused)
49694969

49704970
client = test_framework_new_default_client ();
49714971
BSON_ASSERT (client);
4972+
mongoc_client_set_appname (client, "test_bulk_write_multiple_errors");
49724973

49734974
collection = get_test_collection (client, "test_bulk_write_multiple_errors");
49744975
BSON_ASSERT (collection);
@@ -4977,12 +4978,13 @@ test_bulk_write_multiple_errors (void *unused)
49774978
// the first error.
49784979
bson_append_bool (&opts, "ordered", 7, false);
49794980
bulk = mongoc_collection_create_bulk_operation_with_opts (collection, &opts);
4981+
// Use appName to isolate the failpoint to this test.
49804982
bool ret = mongoc_client_command_simple (
49814983
client,
49824984
"admin",
4983-
tmp_bson (
4984-
"{'configureFailPoint': 'failCommand', 'mode': {'times': 2}, "
4985-
"'data': {'failCommands': ['insert', 'delete'], 'errorCode': 8}}"),
4985+
tmp_bson ("{'configureFailPoint': 'failCommand', 'mode': {'times': 2}, "
4986+
"'data': {'failCommands': ['insert', 'delete'], 'errorCode': "
4987+
"8, 'appName': 'test_bulk_write_multiple_errors'}}"),
49864988
NULL,
49874989
NULL,
49884990
&error);
@@ -5326,5 +5328,7 @@ test_bulk_install (TestSuite *suite)
53265328
test_bulk_write_multiple_errors,
53275329
NULL,
53285330
NULL,
5329-
test_framework_skip_if_no_failpoint);
5331+
test_framework_skip_if_no_failpoint,
5332+
/* Require server 4.2 for failCommand appName */
5333+
test_framework_skip_if_max_wire_version_less_than_8);
53305334
}

0 commit comments

Comments
 (0)