From 8524a15e900102f6b67c3cf0fc5a3fc1d8ae9b96 Mon Sep 17 00:00:00 2001 From: Ross Lawley Date: Tue, 5 May 2026 10:28:03 +0100 Subject: [PATCH] Change stream events are not emitted for timeseries Updated specifications Removed UnifiedTestModification skipping for timeseries change stream test Removed Timeseries prose test JAVA-6181 --- .../mongodb/client/ChangeStreamProseTest.java | 49 ------------------- .../unified/UnifiedTestModifications.java | 2 - testing/resources/specifications | 2 +- 3 files changed, 1 insertion(+), 52 deletions(-) diff --git a/driver-sync/src/test/functional/com/mongodb/client/ChangeStreamProseTest.java b/driver-sync/src/test/functional/com/mongodb/client/ChangeStreamProseTest.java index 1d1af24607..7273d4246e 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/ChangeStreamProseTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/ChangeStreamProseTest.java @@ -25,10 +25,8 @@ import com.mongodb.client.model.Aggregates; import com.mongodb.client.model.ChangeStreamPreAndPostImagesOptions; import com.mongodb.client.model.CreateCollectionOptions; -import com.mongodb.client.model.TimeSeriesOptions; import com.mongodb.client.model.changestream.ChangeStreamDocument; import com.mongodb.client.model.changestream.FullDocumentBeforeChange; -import com.mongodb.client.model.changestream.NamespaceType; import com.mongodb.client.model.changestream.SplitEvent; import com.mongodb.internal.operation.AggregateResponseBatchCursor; import org.bson.BsonArray; @@ -46,14 +44,12 @@ import static com.mongodb.client.CrudTestHelper.repeat; import static com.mongodb.client.model.Updates.set; import static java.util.Arrays.asList; -import static java.util.Collections.singletonList; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -import static org.junit.jupiter.api.Assumptions.assumeFalse; import static org.junit.jupiter.api.Assumptions.assumeTrue; @@ -359,51 +355,6 @@ public void test19SplitChangeStreamEvents() { } } - /** - * Not a prose spec test. However, it is additional test case for better coverage. - */ - @Test - public void testNameSpaceTypePresentChangeStreamEvents() { - assumeTrue(serverVersionAtLeast(8, 1)); - // TODO-JAVA-6181 temp disabling as failing on latest, while specs are updated - assumeFalse(serverVersionAtLeast(9, 0)); - collection.drop(); - - ChangeStreamIterable changeStream = database - .watch() - .fullDocumentBeforeChange(FullDocumentBeforeChange.REQUIRED) - .showExpandedEvents(true); - - try (MongoChangeStreamCursor> cursor = changeStream.cursor()) { - - TimeSeriesOptions timeSeriesOptions = new TimeSeriesOptions("timestampFieldName"); - database.createCollection( - "timeSeriesCollection", - new CreateCollectionOptions().timeSeriesOptions(timeSeriesOptions) - ); - database.createCollection( - getClass().getName(), - new CreateCollectionOptions().changeStreamPreAndPostImagesOptions( - new ChangeStreamPreAndPostImagesOptions(true))); - database.createView( - "view", - "timeSeriesCollection", - singletonList(Document.parse("{ $match: { field: 1 } }")) - ); - - ChangeStreamDocument e1 = Assertions.assertNotNull(cursor.tryNext()); - ChangeStreamDocument e2 = Assertions.assertNotNull(cursor.tryNext()); - ChangeStreamDocument e3 = Assertions.assertNotNull(cursor.tryNext()); - - assertEquals(NamespaceType.TIMESERIES, e1.getNamespaceType()); - assertEquals(NamespaceType.TIMESERIES.getValue(), e1.getNamespaceTypeString()); - assertEquals(NamespaceType.COLLECTION, e2.getNamespaceType()); - assertEquals(NamespaceType.COLLECTION.getValue(), e2.getNamespaceTypeString()); - assertEquals(NamespaceType.VIEW, e3.getNamespaceType()); - assertEquals(NamespaceType.VIEW.getValue(), e3.getNamespaceTypeString()); - } - } - /** * Not a prose spec test. However, it is additional test case for better coverage. */ diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java index 286e6f525a..ea71003c1e 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java @@ -47,8 +47,6 @@ public static void applyCustomizations(final TestDef def) { def.skipNoncompliantReactive("event sensitive tests. We can't guarantee the amount of GetMore commands sent in the reactive driver") .test("change-streams", "change-streams", "Test that comment is set on getMore") .test("change-streams", "change-streams", "Test that comment is not set on getMore - pre 4.4"); - def.skipJira("https://jira.mongodb.org/browse/JAVA-6181 temp disabling as failing on latest, while specs are updated") - .test("change-streams", "change-streams-nsType", "nsType is present when creating timeseries"); def.modify(IGNORE_EXTRA_EVENTS) .test("change-streams", "change-streams", "Test with document comment") .test("change-streams", "change-streams", "Test with string comment"); diff --git a/testing/resources/specifications b/testing/resources/specifications index b519824da6..0f48bb56c2 160000 --- a/testing/resources/specifications +++ b/testing/resources/specifications @@ -1 +1 @@ -Subproject commit b519824da64005cdf99ca680fc49c4e278af0ef3 +Subproject commit 0f48bb56c2046528554aa0899b2bf661bbd4a7bb