DATAMONGO-2322 - Polishing.
Suspend change streams tests relying heavily on timing.
This commit is contained in:
@@ -303,25 +303,27 @@ public class ReactiveTransactionIntegrationTests {
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Mono<Person> declarativeSavePerson(Person person) {
|
||||
public Flux<Person> declarativeSavePerson(Person person) {
|
||||
|
||||
TransactionalOperator transactionalOperator = TransactionalOperator.create(manager,
|
||||
new DefaultTransactionDefinition());
|
||||
|
||||
return operations.save(person) //
|
||||
.flatMap(Mono::just) //
|
||||
.as(transactionalOperator::transactional);
|
||||
return transactionalOperator.execute(reactiveTransaction -> {
|
||||
return operations.save(person);
|
||||
});
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Mono<Person> declarativeSavePersonErrors(Person person) {
|
||||
public Flux<Person> declarativeSavePersonErrors(Person person) {
|
||||
|
||||
TransactionalOperator transactionalOperator = TransactionalOperator.create(manager,
|
||||
new DefaultTransactionDefinition());
|
||||
|
||||
return operations.save(person) //
|
||||
.<Person> flatMap(it -> Mono.error(new RuntimeException("poof!"))) //
|
||||
.as(transactionalOperator::transactional);
|
||||
return transactionalOperator.execute(reactiveTransaction -> {
|
||||
|
||||
return operations.save(person) //
|
||||
.<Person> flatMap(it -> Mono.error(new RuntimeException("poof!")));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ import org.bson.Document;
|
||||
import org.bson.types.ObjectId;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@@ -1358,6 +1359,7 @@ public class ReactiveMongoTemplateTests {
|
||||
}
|
||||
|
||||
@Test // DATAMONGO-1803
|
||||
@Ignore("Heavily relying on timing assumptions. Cannot test message resumption properly. Too much race for too little time in between.")
|
||||
public void changeStreamEventsShouldBeEmittedCorrectly() throws InterruptedException {
|
||||
|
||||
Assumptions.assumeThat(ReplicaSet.required().runsAsReplicaSet()).isTrue();
|
||||
@@ -1390,6 +1392,7 @@ public class ReactiveMongoTemplateTests {
|
||||
}
|
||||
|
||||
@Test // DATAMONGO-1803
|
||||
@Ignore("Heavily relying on timing assumptions. Cannot test message resumption properly. Too much race for too little time in between.")
|
||||
public void changeStreamEventsShouldBeConvertedCorrectly() throws InterruptedException {
|
||||
|
||||
Assumptions.assumeThat(ReplicaSet.required().runsAsReplicaSet()).isTrue();
|
||||
@@ -1422,6 +1425,7 @@ public class ReactiveMongoTemplateTests {
|
||||
}
|
||||
|
||||
@Test // DATAMONGO-1803
|
||||
@Ignore("Heavily relying on timing assumptions. Cannot test message resumption properly. Too much race for too little time in between.")
|
||||
public void changeStreamEventsShouldBeFilteredCorrectly() throws InterruptedException {
|
||||
|
||||
Assumptions.assumeThat(ReplicaSet.required().runsAsReplicaSet()).isTrue();
|
||||
@@ -1498,6 +1502,7 @@ public class ReactiveMongoTemplateTests {
|
||||
}
|
||||
|
||||
@Test // DATAMONGO-1803
|
||||
@Ignore("Heavily relying on timing assumptions. Cannot test message resumption properly. Too much race for too little time in between.")
|
||||
public void changeStreamEventsShouldBeResumedCorrectly() throws InterruptedException {
|
||||
|
||||
Assumptions.assumeThat(ReplicaSet.required().runsAsReplicaSet()).isTrue();
|
||||
|
||||
Reference in New Issue
Block a user