Skip to content

Commit 050f408

Browse files
authored
RUBY-3103 Exclude create events from change stream events when testing showExpandedEvents (#2612)
1 parent a71064f commit 050f408

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

spec/spec_tests/data/change_streams_unified/change-streams-showExpandedEvents.yml

Lines changed: 11 additions & 4 deletions
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
@@ -259,9 +267,7 @@ tests:
259267
arguments:
260268
command:
261269
collMod: *collection0
262-
# Added here to fix our tests as we require a commandName but don't
263-
# do anything with it.
264-
commandName: modify_collection
270+
commandName: collMod
265271
- name: iterateUntilDocumentOrError
266272
object: *changeStream0
267273
expectResult:
@@ -292,6 +298,7 @@ tests:
292298
shardCollection: shardedDb.shardedCollection
293299
key:
294300
_id: 1
301+
commandName: shardCollection
295302
- name: iterateUntilDocumentOrError
296303
object: *changeStream0
297304
expectResult:

0 commit comments

Comments
 (0)