From ac804cd607c6b2434c642d55246b63dbc22b0bf4 Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Thu, 7 Dec 2023 08:21:56 -0500 Subject: [PATCH 1/5] Pull mongohouse image from ADL ECR repo JAVA-5235 --- .evergreen/.evg.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.evergreen/.evg.yml b/.evergreen/.evg.yml index 4aa9ec762e9..c62b7e6a9bf 100644 --- a/.evergreen/.evg.yml +++ b/.evergreen/.evg.yml @@ -160,12 +160,11 @@ functions: - command: shell.exec params: script: | - DRIVERS_TOOLS="${DRIVERS_TOOLS}" sh ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/build-mongohouse-local.sh + DRIVERS_TOOLS="${DRIVERS_TOOLS}" sh ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/pull-mongohouse-image.sh - command: shell.exec params: - background: true script: | - DRIVERS_TOOLS="${DRIVERS_TOOLS}" sh ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/run-mongohouse-local.sh + DRIVERS_TOOLS="${DRIVERS_TOOLS}" sh ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/run-mongohouse-image.sh "run load-balancer": - command: shell.exec From 31ce4590b6879834cc7a7115bba3c925bb32cd49 Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Thu, 7 Dec 2023 09:03:44 -0500 Subject: [PATCH 2/5] Use bash --- .evergreen/.evg.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.evergreen/.evg.yml b/.evergreen/.evg.yml index c62b7e6a9bf..5102ce130b0 100644 --- a/.evergreen/.evg.yml +++ b/.evergreen/.evg.yml @@ -160,11 +160,11 @@ functions: - command: shell.exec params: script: | - DRIVERS_TOOLS="${DRIVERS_TOOLS}" sh ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/pull-mongohouse-image.sh + DRIVERS_TOOLS="${DRIVERS_TOOLS}" bash ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/pull-mongohouse-image.sh - command: shell.exec params: script: | - DRIVERS_TOOLS="${DRIVERS_TOOLS}" sh ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/run-mongohouse-image.sh + DRIVERS_TOOLS="${DRIVERS_TOOLS}" bash ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/run-mongohouse-image.sh "run load-balancer": - command: shell.exec From f82cb6824eab2d6abfa0ef582ad34a1824e08891 Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Thu, 7 Dec 2023 09:39:24 -0500 Subject: [PATCH 3/5] Debugging --- .../com/mongodb/client/CommandMonitoringTestHelper.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/driver-core/src/test/functional/com/mongodb/client/CommandMonitoringTestHelper.java b/driver-core/src/test/functional/com/mongodb/client/CommandMonitoringTestHelper.java index 8ba3a5b3851..ff84a577cbb 100644 --- a/driver-core/src/test/functional/com/mongodb/client/CommandMonitoringTestHelper.java +++ b/driver-core/src/test/functional/com/mongodb/client/CommandMonitoringTestHelper.java @@ -37,6 +37,8 @@ import org.bson.codecs.configuration.CodecProvider; import org.bson.codecs.configuration.CodecRegistries; import org.bson.codecs.configuration.CodecRegistry; +import org.bson.json.JsonMode; +import org.bson.json.JsonWriterSettings; import java.util.ArrayList; import java.util.List; @@ -142,7 +144,10 @@ public static void assertEventsEquality(final List expectedEvents, lsidMap, expectedCommandStartedEvent); assertEquals(expectedCommandStartedEvent.getDatabaseName(), actualCommandStartedEvent.getDatabaseName()); - assertEquals(expectedCommandStartedEvent.getCommand(), actualCommandStartedEvent.getCommand()); + JsonWriterSettings settings = JsonWriterSettings.builder().outputMode(JsonMode.EXTENDED).build(); + assertEquals("Expected: " + expectedCommandStartedEvent.getCommand().toJson(settings) + + "Actual: " + actualCommandStartedEvent.getCommand().toJson(settings), + expectedCommandStartedEvent.getCommand(), actualCommandStartedEvent.getCommand()); if (((CommandStartedEvent) expected).getCommand().containsKey("recoveryToken")) { if (((CommandStartedEvent) expected).getCommand().get("recoveryToken").isNull()) { assertFalse(((CommandStartedEvent) actual).getCommand().containsKey("recoveryToken")); From dfdb9a0eee5bdba65ac0867a8bbc505408992d41 Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Thu, 7 Dec 2023 09:57:13 -0500 Subject: [PATCH 4/5] Updated ADL test batch size assertion --- driver-core/src/test/resources/atlas-data-lake/getMore.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/driver-core/src/test/resources/atlas-data-lake/getMore.json b/driver-core/src/test/resources/atlas-data-lake/getMore.json index fa1deab4f39..9aa2c2de1d2 100644 --- a/driver-core/src/test/resources/atlas-data-lake/getMore.json +++ b/driver-core/src/test/resources/atlas-data-lake/getMore.json @@ -4,6 +4,7 @@ "tests": [ { "description": "A successful find event with getMore", + "comment": "UPDATED final batchSize to 3 as batchSize is no longer calculated see: DRIVERS-1448 ", "operations": [ { "object": "collection", @@ -45,7 +46,7 @@ { "command_started_event": { "command": { - "batchSize": 1 + "batchSize": 3 }, "command_name": "getMore", "database_name": "cursors" @@ -54,4 +55,4 @@ ] } ] -} \ No newline at end of file +} From d2c48b689b2e719b2cecd04bfc1a5b6c3695857d Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Thu, 7 Dec 2023 09:57:49 -0500 Subject: [PATCH 5/5] Revert debugging --- .../com/mongodb/client/CommandMonitoringTestHelper.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/driver-core/src/test/functional/com/mongodb/client/CommandMonitoringTestHelper.java b/driver-core/src/test/functional/com/mongodb/client/CommandMonitoringTestHelper.java index ff84a577cbb..8ba3a5b3851 100644 --- a/driver-core/src/test/functional/com/mongodb/client/CommandMonitoringTestHelper.java +++ b/driver-core/src/test/functional/com/mongodb/client/CommandMonitoringTestHelper.java @@ -37,8 +37,6 @@ import org.bson.codecs.configuration.CodecProvider; import org.bson.codecs.configuration.CodecRegistries; import org.bson.codecs.configuration.CodecRegistry; -import org.bson.json.JsonMode; -import org.bson.json.JsonWriterSettings; import java.util.ArrayList; import java.util.List; @@ -144,10 +142,7 @@ public static void assertEventsEquality(final List expectedEvents, lsidMap, expectedCommandStartedEvent); assertEquals(expectedCommandStartedEvent.getDatabaseName(), actualCommandStartedEvent.getDatabaseName()); - JsonWriterSettings settings = JsonWriterSettings.builder().outputMode(JsonMode.EXTENDED).build(); - assertEquals("Expected: " + expectedCommandStartedEvent.getCommand().toJson(settings) - + "Actual: " + actualCommandStartedEvent.getCommand().toJson(settings), - expectedCommandStartedEvent.getCommand(), actualCommandStartedEvent.getCommand()); + assertEquals(expectedCommandStartedEvent.getCommand(), actualCommandStartedEvent.getCommand()); if (((CommandStartedEvent) expected).getCommand().containsKey("recoveryToken")) { if (((CommandStartedEvent) expected).getCommand().get("recoveryToken").isNull()) { assertFalse(((CommandStartedEvent) actual).getCommand().containsKey("recoveryToken"));