SERVER-114489 Update read_write_concern_defaults_application.js to be independent of UWE configuration (#44538)

GitOrigin-RevId: e46855a341925ffaf81d5bfc133a4ace6119e289
This commit is contained in:
Rui Liu 2025-12-02 15:17:05 +00:00 committed by MongoDB Bot
parent 077c4688d1
commit a3f6144b2d
2 changed files with 8 additions and 6 deletions

View File

@ -36,7 +36,7 @@ selector:
- jstests/sharding/query/out_merge/**/*.js
# - jstests/sharding/query/update/update_shard_key_bulk_write.js
# - jstests/sharding/query/update_delete_many_metrics.js
# - jstests/sharding/read_write_concern_defaults_application.js
- jstests/sharding/read_write_concern_defaults_application.js
- jstests/sharding/retryable_update_one_by_id_chunk_migration.js
- jstests/sharding/retryable_upsert_single_write_shard.js
- jstests/sharding/retryable_write_error_labels.js

View File

@ -624,6 +624,9 @@ let testCases = {
command: {insert: coll, documents: [{_id: ObjectId()}]},
checkReadConcern: false,
checkWriteConcern: true,
// TODO SERVER-23266: The overall batch command is profiled, however, when UWE is enabled the insert would be
// sent as a bulkWrite command. It would be better to use profiling. In the meantime, use logs.
useLogs: true,
},
internalRenameIfOptionsAndIndexesMatch: {skip: "internal command"},
invalidateUserCache: {skip: "does not accept read or write concern"},
@ -915,15 +918,14 @@ let setDefaultRWConcernActualTestCase = {
// generated by this function:
// 2020-01-28T16:46:57.373+1100 I COMMAND [conn18] command test.foo appName: "MongoDB Shell"
// command: aggregate { aggregate: "foo", ..., comment: "5e2fcad149034875e22c9fbc", ... }
// ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// . ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// planSummary: COLLSCAN keysExamined:0 docsExamined:1 ... readConcern:{ level: "majority" }
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// writeConcern:{ w: "majority", wtimeout: 1234567 } storage:{} protocol:op_msg 275ms
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
function createLogLineRegularExpressionForTestCase(test, cmdName, targetId, explicitRWC) {
function createLogLineRegularExpressionForTestCase(test, targetId, explicitRWC) {
let expectedProvenance = explicitRWC ? "clientSupplied" : "customDefault";
let pattern = `"command":{"${cmdName}"`;
pattern += `.*"comment":"${targetId}"`;
let pattern = `"comment":"${targetId}"`;
if (test.checkReadConcern) {
pattern += `.*"readConcern":{"level":"majority","provenance":"${expectedProvenance}"}`;
}
@ -1094,7 +1096,7 @@ function runScenario(desc, conn, regularCheckConn, configSvrCheckConn, {explicit
// Check that the command applied the correct RWC.
if (test.useLogs) {
let re = createLogLineRegularExpressionForTestCase(test, cmdName, targetId, explicitRWC);
let re = createLogLineRegularExpressionForTestCase(test, targetId, explicitRWC);
assert(
checkLog.checkContainsOnce(checkConn, re),
"unable to find pattern " + re + " in logs on " + checkConn + " for test " + thisTestDesc,