In Python we log "durationMS" as a float to avoid truncating the value:
2024-11-04 14:04:46,886 DEBUG logger {"topologyId": {"$oid": "672944fe6efb88205cc4b5c3"}, "driverConnectionId": 1, "serverConnectionId": 777, "serverHost": "localhost", "serverPort": 27017, "awaited": false, "durationMS": 1.9565420225262642, "reply": "{\"helloOk\": true, \"ismaster\": true, \"topologyVersion\": {\"processId\": {\"$oid\": \"67240e9bb9de113c205b2beb\"}}, \"maxBsonObjectSize\": 16777216, \"maxMessageSizeBytes\": 48000000, \"maxWriteBatchSize\": 100000, \"localTime\": {\"$date\": \"2024-11-04T22:04:46.886Z\"}, \"logicalSessionTimeoutMinutes\": 30, \"connectionId\": 777, \"maxWireVersion\": 25, \"ok\": 1.0}", "message": "Server heartbeat succeeded"}
However, the SDAM logging tests require "durationMS" to be an integer:
durationMS: { $$type: [int, long] }
The Command logging and CMAP logging tests already allow "durationMS" to be a double so there is prior art here:
durationMS: { $$type: [double, int, long] }
- https://github.com/mongodb/specifications/blob/6b267ddc7cca303a722d2893106fad4810709f06/source/command-logging-and-monitoring/tests/logging/command.yml#L61
- https://github.com/mongodb/specifications/blob/8e8db00/source/connection-monitoring-and-pooling/tests/logging/connection-logging.yml#L69
Uncovered by DRIVERS-2573 (and PYTHON-4925).
- related to
-
PYTHON-4925 Fix testing bugs in $$matchAsRoot and $$matchAsDocument operators
- Closed
-
DRIVERS-2573 Add valid-pass and valid-fail tests for $$matchAsRoot and $$matchAsDocument operators
- Implementing
- split to
-
PYTHON-4925 Fix testing bugs in $$matchAsRoot and $$matchAsDocument operators
- Closed