PYTHON-4322 Fix racy unified tests of unacknowledged writes (#1578)
This commit is contained in:
parent
9d43606662
commit
e40ff35168
@ -1,6 +1,6 @@
|
||||
{
|
||||
"description": "unacknowledged-write",
|
||||
"schemaVersion": "1.13",
|
||||
"schemaVersion": "1.16",
|
||||
"createEntities": [
|
||||
{
|
||||
"client": {
|
||||
@ -53,11 +53,27 @@
|
||||
"_id": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "find",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"filter": {}
|
||||
},
|
||||
"expectResult": [
|
||||
{
|
||||
"_id": 1
|
||||
},
|
||||
{
|
||||
"_id": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"expectLogMessages": [
|
||||
{
|
||||
"client": "client",
|
||||
"ignoreExtraMessages": true,
|
||||
"messages": [
|
||||
{
|
||||
"level": "debug",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"description": "unacknowledgedBulkWrite",
|
||||
"schemaVersion": "1.0",
|
||||
"schemaVersion": "1.7",
|
||||
"createEntities": [
|
||||
{
|
||||
"client": {
|
||||
@ -64,11 +64,29 @@
|
||||
],
|
||||
"ordered": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "find",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"filter": {}
|
||||
},
|
||||
"expectResult": [
|
||||
{
|
||||
"_id": 1,
|
||||
"x": 11
|
||||
},
|
||||
{
|
||||
"_id": "unorderedBulkWriteInsertW0",
|
||||
"x": 44
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"expectEvents": [
|
||||
{
|
||||
"client": "client",
|
||||
"ignoreExtraEvents": true,
|
||||
"events": [
|
||||
{
|
||||
"commandStartedEvent": {
|
||||
|
||||
@ -1788,6 +1788,8 @@ class UnifiedSpecTestMixinV1(IntegrationTest):
|
||||
clientid = self.entity_map[client["client"]]._topology_settings._topology_id
|
||||
actual_logs = formatted_logs[clientid]
|
||||
actual_logs = [log for log in actual_logs if log["component"] in components]
|
||||
if client.get("ignoreExtraMessages", False):
|
||||
actual_logs = actual_logs[: len(client["messages"])]
|
||||
self.assertEqual(len(client["messages"]), len(actual_logs))
|
||||
for expected_msg, actual_msg in zip(client["messages"], actual_logs):
|
||||
expected_data, actual_data = expected_msg.pop("data"), actual_msg.pop("data")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user