File tree Expand file tree Collapse file tree 4 files changed +118
-60
lines changed Expand file tree Collapse file tree 4 files changed +118
-60
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ class ChangeStream implements Iterator
47
47
136 , // CappedPositionLost
48
48
237 , // CursorKilled
49
49
11601 , // Interrupted
50
+ 280 , // ChangeStreamFatalError
50
51
];
51
52
52
53
/** @var callable */
@@ -180,6 +181,11 @@ private function isResumableError(RuntimeException $exception)
180
181
return false ;
181
182
}
182
183
184
+ /* The ServerException doesn't expose the NonResumableChangeStreamError
185
+ * label. Thus, the error code for the corresponding server exception
186
+ * has been marked as non-resumable. This can be reverted once PHPC-1419
187
+ * is fixed.
188
+ */
183
189
if ($ exception ->hasErrorLabel ('NonResumableChangeStreamError ' )) {
184
190
return false ;
185
191
}
Original file line number Diff line number Diff line change @@ -935,6 +935,10 @@ public function testChangeStreamExample_1_4()
935
935
{
936
936
$ this ->skipIfChangeStreamIsNotSupported ();
937
937
938
+ if ($ this ->isShardedCluster ()) {
939
+ $ this ->markTestSkipped ('Test does not apply on sharded clusters: need more than a single getMore call on the change stream. ' );
940
+ }
941
+
938
942
$ db = new Database ($ this ->manager , $ this ->getDatabaseName ());
939
943
$ db ->dropCollection ('inventory ' );
940
944
$ db ->createCollection ('inventory ' );
Original file line number Diff line number Diff line change @@ -334,9 +334,6 @@ protected function skipIfChangeStreamIsNotSupported()
334
334
if (! $ this ->isShardedClusterUsingReplicasets ()) {
335
335
$ this ->markTestSkipped ('$changeStream is only supported with replicasets ' );
336
336
}
337
-
338
- // Temporarily skip tests because of an issue with change streams in the driver
339
- $ this ->markTestSkipped ('$changeStreams currently don \'t on replica sets ' );
340
337
break ;
341
338
342
339
case Server::TYPE_RS_PRIMARY :
You can’t perform that action at this time.
0 commit comments