Skip to content

Commit 32b6d82

Browse files
committed
Fix race condition in testFluxChannelCleanUp
Turns out `done` in the `SinkManyEmitterProcessor` is set to `true` when we already processed all the data. Therefore, it is better to `await().until()` for `done` condition in the end of test
1 parent ffe50d2 commit 32b6d82

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spring-integration-core/src/test/java/org/springframework/integration/channel/reactive/FluxMessageChannelTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
5151

5252
import static org.assertj.core.api.Assertions.assertThat;
53+
import static org.awaitility.Awaitility.await;
5354

5455
/**
5556
* @author Artem Bilan
@@ -139,7 +140,8 @@ void testFluxMessageChannelCleanUp() throws InterruptedException {
139140

140141
flowRegistration.destroy();
141142

142-
assertThat(TestUtils.getPropertyValue(flux, "sink.sink.done", Boolean.class)).isTrue();
143+
await()
144+
.until(() -> TestUtils.getPropertyValue(flux, "sink.sink.done", Boolean.class));
143145
}
144146

145147
@Configuration

0 commit comments

Comments
 (0)