Skip to content

Commit

Permalink
Stop endpoints in the end of tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
artembilan committed Jan 17, 2020
1 parent 715e9a2 commit 4b05168
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -99,6 +99,8 @@ public void testReactiveStreamsConsumerFluxMessageChannel() throws InterruptedEx

assertThat(stopLatch.await(10, TimeUnit.SECONDS)).isTrue();
assertThat(result).containsExactly(testMessage, testMessage2);

reactiveConsumer.stop();
}


Expand Down Expand Up @@ -222,6 +224,8 @@ public void testReactiveStreamsConsumerPollableChannel() throws InterruptedExcep
verify(testSubscriber, never()).onComplete();

assertThat(messages.isEmpty()).isTrue();

reactiveConsumer.stop();
}

@Test
Expand Down Expand Up @@ -264,6 +268,8 @@ public void testReactiveStreamsConsumerViaConsumerEndpointFactoryBean() throws E
assertThat(stopLatch.await(10, TimeUnit.SECONDS)).isTrue();
assertThat(result.size()).isEqualTo(3);
assertThat(result).containsExactly(testMessage, testMessage2, testMessage2);

endpointFactoryBean.stop();
}

@Test
Expand Down Expand Up @@ -302,7 +308,8 @@ public void testReactiveStreamsConsumerFluxMessageChannelReactiveMessageHandler(
.expectNext(testMessage, testMessage2)
.thenCancel()
.verify();
}

reactiveConsumer.stop();
}

}

0 comments on commit 4b05168

Please sign in to comment.