Stop endpoints in the end of tests

https://build.spring.io/browse/INT-MASTERSPRING40-954/

The `ReactiveStreamsConsumerTests` fails with some race condition from time to time.
Possible reason that no one endpoint is stopped in the end of test.
Even if we step out from the test method, background threads are still active
This commit is contained in:
Artem Bilan
2020-01-17 09:55:11 -05:00
parent 715e9a2042
commit 4b051684ef

View File

@@ -99,6 +99,8 @@ public class ReactiveStreamsConsumerTests {
assertThat(stopLatch.await(10, TimeUnit.SECONDS)).isTrue();
assertThat(result).containsExactly(testMessage, testMessage2);
reactiveConsumer.stop();
}
@@ -222,6 +224,8 @@ public class ReactiveStreamsConsumerTests {
verify(testSubscriber, never()).onComplete();
assertThat(messages.isEmpty()).isTrue();
reactiveConsumer.stop();
}
@Test
@@ -264,6 +268,8 @@ public class ReactiveStreamsConsumerTests {
assertThat(stopLatch.await(10, TimeUnit.SECONDS)).isTrue();
assertThat(result.size()).isEqualTo(3);
assertThat(result).containsExactly(testMessage, testMessage2, testMessage2);
endpointFactoryBean.stop();
}
@Test
@@ -302,7 +308,8 @@ public class ReactiveStreamsConsumerTests {
.expectNext(testMessage, testMessage2)
.thenCancel()
.verify();
reactiveConsumer.stop();
}
}