-
Notifications
You must be signed in to change notification settings - Fork 246
Expand file tree
/
Copy pathbackpressure-retry-max-attempts.yml.template
More file actions
102 lines (90 loc) · 3.38 KB
/
backpressure-retry-max-attempts.yml.template
File metadata and controls
102 lines (90 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Tests in this file are generated from backpressure-retry-max-attempts.yml.template.
description: tests that operations retry at most maxAttempts=5 times
schemaVersion: '1.3'
runOnRequirements:
-
minServerVersion: '4.4' # failCommand
topologies: [replicaset, sharded, load-balanced]
createEntities:
- client:
id: &client client
useMultipleMongoses: false
observeEvents: [commandStartedEvent, commandSucceededEvent, commandFailedEvent]
ignoreCommandMonitoringEvents: [killCursors]
- client:
id: &fail_point_client fail_point_client
useMultipleMongoses: false
- database:
id: &database database
client: *client
databaseName: &database_name retryable-writes-tests
- collection:
id: &collection collection
database: *database
collectionName: &collection_name coll
_yamlAnchors:
bulkWriteInsertNamespace: &client_bulk_write_ns retryable-writes-tests.coll
initialData:
- collectionName: *collection_name
databaseName: *database_name
documents:
- { _id: 1, x: 11 }
- { _id: 2, x: 22 }
tests: {% for operation in operations %}
- description: '{{operation.object}}.{{operation.operation_name}}{{ " " + operation.operation_type + "" if operation.operation_name == "aggregate" else "" }} retries at most maxAttempts=5 times'
{%- if ((operation.operation_name == 'clientBulkWrite')) %}
runOnRequirements:
- minServerVersion: '8.0' # client bulk write added to server in 8.0
{%- endif %}
operations:
- name: failPoint
object: testRunner
arguments:
client: *fail_point_client
failPoint:
configureFailPoint: failCommand
mode: alwaysOn
data:
failCommands: [{{operation.command_name}}]
errorLabels: [RetryableError, SystemOverloadedError]
errorCode: 2
- name: {{operation.operation_name}}
object: *{{operation.object}} {%- if operation.arguments|length > 0 %}
arguments:
{%- for arg in operation.arguments %}
{{arg}}
{%- endfor -%}
{%- endif %}
expectError:
isError: true
isClientError: false
expectEvents:
- client: *client
events:
# we expect 6 pairs of command started and succeeded events:
# 1 initial attempt and 5 retries.
- commandStartedEvent:
commandName: {{operation.command_name}}
- commandFailedEvent:
commandName: {{operation.command_name}}
- commandStartedEvent:
commandName: {{operation.command_name}}
- commandFailedEvent:
commandName: {{operation.command_name}}
- commandStartedEvent:
commandName: {{operation.command_name}}
- commandFailedEvent:
commandName: {{operation.command_name}}
- commandStartedEvent:
commandName: {{operation.command_name}}
- commandFailedEvent:
commandName: {{operation.command_name}}
- commandStartedEvent:
commandName: {{operation.command_name}}
- commandFailedEvent:
commandName: {{operation.command_name}}
- commandStartedEvent:
commandName: {{operation.command_name}}
- commandFailedEvent:
commandName: {{operation.command_name}}
{% endfor -%}