Skip to content

Commit 5174162

Browse files
authored
DRIVERS-2417: Exclude create events from change stream when testing showExpandedEvents (#1293)
1 parent 59ca78e commit 5174162

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

source/change-streams/tests/unified/change-streams-showExpandedEvents.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,15 @@
275275
"name": "createChangeStream",
276276
"object": "collection0",
277277
"arguments": {
278-
"pipeline": [],
278+
"pipeline": [
279+
{
280+
"$match": {
281+
"operationType": {
282+
"$ne": "create"
283+
}
284+
}
285+
}
286+
],
279287
"showExpandedEvents": true
280288
},
281289
"saveResultAsEntity": "changeStream0"

source/change-streams/tests/unified/change-streams-showExpandedEvents.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,15 @@ tests:
160160
- name: createChangeStream
161161
object: *collection0
162162
arguments:
163-
pipeline: []
163+
pipeline:
164+
# On sharded clusters, the create command run when loading initial
165+
# data sometimes is still reported in the change stream. To avoid
166+
# this, we exclude the create command when creating the change
167+
# stream, but specifically don't exclude other events to still catch
168+
# driver errors.
169+
- $match:
170+
operationType:
171+
$ne: create
164172
showExpandedEvents: true
165173
saveResultAsEntity: &changeStream0 changeStream0
166174
- name: createIndex

0 commit comments

Comments
 (0)