From 014f84ebb8d7f477ba03c3158cf99b50de6f5343 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 19 Mar 2025 16:02:12 -0400 Subject: [PATCH] DRIVERS-3139: Revise assertion for unacknowledged client bulkWrite result This makes the assertion consistent with collection bulkWrites by allowing for an entirely optional result and conditionally checking acknowledged=false. --- .../unacknowledged-client-bulkWrite.json | 51 ++++++++++--------- .../unacknowledged-client-bulkWrite.yml | 26 ++++------ 2 files changed, 38 insertions(+), 39 deletions(-) diff --git a/source/command-logging-and-monitoring/tests/monitoring/unacknowledged-client-bulkWrite.json b/source/command-logging-and-monitoring/tests/monitoring/unacknowledged-client-bulkWrite.json index 61bb00726c..14740cea34 100644 --- a/source/command-logging-and-monitoring/tests/monitoring/unacknowledged-client-bulkWrite.json +++ b/source/command-logging-and-monitoring/tests/monitoring/unacknowledged-client-bulkWrite.json @@ -95,29 +95,34 @@ "ordered": false }, "expectResult": { - "insertedCount": { - "$$unsetOrMatches": 0 - }, - "upsertedCount": { - "$$unsetOrMatches": 0 - }, - "matchedCount": { - "$$unsetOrMatches": 0 - }, - "modifiedCount": { - "$$unsetOrMatches": 0 - }, - "deletedCount": { - "$$unsetOrMatches": 0 - }, - "insertResults": { - "$$unsetOrMatches": {} - }, - "updateResults": { - "$$unsetOrMatches": {} - }, - "deleteResults": { - "$$unsetOrMatches": {} + "$$unsetOrMatches": { + "acknowledged": { + "$$unsetOrMatches": false + }, + "insertedCount": { + "$$unsetOrMatches": 0 + }, + "upsertedCount": { + "$$unsetOrMatches": 0 + }, + "matchedCount": { + "$$unsetOrMatches": 0 + }, + "modifiedCount": { + "$$unsetOrMatches": 0 + }, + "deletedCount": { + "$$unsetOrMatches": 0 + }, + "insertResults": { + "$$unsetOrMatches": {} + }, + "updateResults": { + "$$unsetOrMatches": {} + }, + "deleteResults": { + "$$unsetOrMatches": {} + } } } }, diff --git a/source/command-logging-and-monitoring/tests/monitoring/unacknowledged-client-bulkWrite.yml b/source/command-logging-and-monitoring/tests/monitoring/unacknowledged-client-bulkWrite.yml index 2d54525953..f43f097c3d 100644 --- a/source/command-logging-and-monitoring/tests/monitoring/unacknowledged-client-bulkWrite.yml +++ b/source/command-logging-and-monitoring/tests/monitoring/unacknowledged-client-bulkWrite.yml @@ -52,22 +52,16 @@ tests: update: { $set: { x: 333 } } ordered: false expectResult: - insertedCount: - $$unsetOrMatches: 0 - upsertedCount: - $$unsetOrMatches: 0 - matchedCount: - $$unsetOrMatches: 0 - modifiedCount: - $$unsetOrMatches: 0 - deletedCount: - $$unsetOrMatches: 0 - insertResults: - $$unsetOrMatches: {} - updateResults: - $$unsetOrMatches: {} - deleteResults: - $$unsetOrMatches: {} + $$unsetOrMatches: + acknowledged: { $$unsetOrMatches: false } + insertedCount: { $$unsetOrMatches: 0 } + upsertedCount: { $$unsetOrMatches: 0 } + matchedCount: { $$unsetOrMatches: 0 } + modifiedCount: { $$unsetOrMatches: 0 } + deletedCount: { $$unsetOrMatches: 0 } + insertResults: { $$unsetOrMatches: {} } + updateResults: { $$unsetOrMatches: {} } + deleteResults: { $$unsetOrMatches: {} } # Force completion of the w:0 write by executing a find on the same connection - object: *collection name: find