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
This commit is contained in:
@@ -50,6 +50,7 @@ import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.awaitility.Awaitility.await;
|
||||
|
||||
/**
|
||||
* @author Artem Bilan
|
||||
@@ -139,7 +140,8 @@ public class FluxMessageChannelTests {
|
||||
|
||||
flowRegistration.destroy();
|
||||
|
||||
assertThat(TestUtils.getPropertyValue(flux, "sink.sink.done", Boolean.class)).isTrue();
|
||||
await()
|
||||
.until(() -> TestUtils.getPropertyValue(flux, "sink.sink.done", Boolean.class));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
|
||||
Reference in New Issue
Block a user