diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/fn/data/BeamFnDataInboundObserverTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/fn/data/BeamFnDataInboundObserverTest.java index bd279cee208a..ee7a2d9aebaa 100644 --- a/sdks/java/core/src/test/java/org/apache/beam/sdk/fn/data/BeamFnDataInboundObserverTest.java +++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/fn/data/BeamFnDataInboundObserverTest.java @@ -165,6 +165,7 @@ public void testCloseVisibleToAwaitCompletionCallerAndProducer() throws Exceptio Future future2 = executor.submit( () -> { + Thread.sleep(500); // give the previous future some time to reach the inf while loop observer.close(); return null; });