Skip to content

Commit 503c4ca

Browse files
authored
Change stream events are not emitted for timeseries (#1959)
Removed UnifiedTestModification skipping for timeseries change stream test Removed Timeseries prose test JAVA-6181
1 parent 7655b82 commit 503c4ca

2 files changed

Lines changed: 0 additions & 51 deletions

File tree

driver-sync/src/test/functional/com/mongodb/client/ChangeStreamProseTest.java

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@
2525
import com.mongodb.client.model.Aggregates;
2626
import com.mongodb.client.model.ChangeStreamPreAndPostImagesOptions;
2727
import com.mongodb.client.model.CreateCollectionOptions;
28-
import com.mongodb.client.model.TimeSeriesOptions;
2928
import com.mongodb.client.model.changestream.ChangeStreamDocument;
3029
import com.mongodb.client.model.changestream.FullDocumentBeforeChange;
31-
import com.mongodb.client.model.changestream.NamespaceType;
3230
import com.mongodb.client.model.changestream.SplitEvent;
3331
import com.mongodb.internal.operation.AggregateResponseBatchCursor;
3432
import org.bson.BsonArray;
@@ -46,14 +44,12 @@
4644
import static com.mongodb.client.CrudTestHelper.repeat;
4745
import static com.mongodb.client.model.Updates.set;
4846
import static java.util.Arrays.asList;
49-
import static java.util.Collections.singletonList;
5047
import static org.junit.jupiter.api.Assertions.assertEquals;
5148
import static org.junit.jupiter.api.Assertions.assertNotEquals;
5249
import static org.junit.jupiter.api.Assertions.assertNotNull;
5350
import static org.junit.jupiter.api.Assertions.assertNull;
5451
import static org.junit.jupiter.api.Assertions.assertTrue;
5552
import static org.junit.jupiter.api.Assertions.fail;
56-
import static org.junit.jupiter.api.Assumptions.assumeFalse;
5753
import static org.junit.jupiter.api.Assumptions.assumeTrue;
5854

5955

@@ -359,51 +355,6 @@ public void test19SplitChangeStreamEvents() {
359355
}
360356
}
361357

362-
/**
363-
* Not a prose spec test. However, it is additional test case for better coverage.
364-
*/
365-
@Test
366-
public void testNameSpaceTypePresentChangeStreamEvents() {
367-
assumeTrue(serverVersionAtLeast(8, 1));
368-
// TODO-JAVA-6181 temp disabling as failing on latest, while specs are updated
369-
assumeFalse(serverVersionAtLeast(9, 0));
370-
collection.drop();
371-
372-
ChangeStreamIterable<Document> changeStream = database
373-
.watch()
374-
.fullDocumentBeforeChange(FullDocumentBeforeChange.REQUIRED)
375-
.showExpandedEvents(true);
376-
377-
try (MongoChangeStreamCursor<ChangeStreamDocument<Document>> cursor = changeStream.cursor()) {
378-
379-
TimeSeriesOptions timeSeriesOptions = new TimeSeriesOptions("timestampFieldName");
380-
database.createCollection(
381-
"timeSeriesCollection",
382-
new CreateCollectionOptions().timeSeriesOptions(timeSeriesOptions)
383-
);
384-
database.createCollection(
385-
getClass().getName(),
386-
new CreateCollectionOptions().changeStreamPreAndPostImagesOptions(
387-
new ChangeStreamPreAndPostImagesOptions(true)));
388-
database.createView(
389-
"view",
390-
"timeSeriesCollection",
391-
singletonList(Document.parse("{ $match: { field: 1 } }"))
392-
);
393-
394-
ChangeStreamDocument<Document> e1 = Assertions.assertNotNull(cursor.tryNext());
395-
ChangeStreamDocument<Document> e2 = Assertions.assertNotNull(cursor.tryNext());
396-
ChangeStreamDocument<Document> e3 = Assertions.assertNotNull(cursor.tryNext());
397-
398-
assertEquals(NamespaceType.TIMESERIES, e1.getNamespaceType());
399-
assertEquals(NamespaceType.TIMESERIES.getValue(), e1.getNamespaceTypeString());
400-
assertEquals(NamespaceType.COLLECTION, e2.getNamespaceType());
401-
assertEquals(NamespaceType.COLLECTION.getValue(), e2.getNamespaceTypeString());
402-
assertEquals(NamespaceType.VIEW, e3.getNamespaceType());
403-
assertEquals(NamespaceType.VIEW.getValue(), e3.getNamespaceTypeString());
404-
}
405-
}
406-
407358
/**
408359
* Not a prose spec test. However, it is additional test case for better coverage.
409360
*/

driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ public static void applyCustomizations(final TestDef def) {
4747
def.skipNoncompliantReactive("event sensitive tests. We can't guarantee the amount of GetMore commands sent in the reactive driver")
4848
.test("change-streams", "change-streams", "Test that comment is set on getMore")
4949
.test("change-streams", "change-streams", "Test that comment is not set on getMore - pre 4.4");
50-
def.skipJira("https://jira.mongodb.org/browse/JAVA-6181 temp disabling as failing on latest, while specs are updated")
51-
.test("change-streams", "change-streams-nsType", "nsType is present when creating timeseries");
5250
def.modify(IGNORE_EXTRA_EVENTS)
5351
.test("change-streams", "change-streams", "Test with document comment")
5452
.test("change-streams", "change-streams", "Test with string comment");

0 commit comments

Comments
 (0)