Skip to content

Commit 3a25c3c

Browse files
committed
test: add delay before negative assertion in event isolation test
Signed-off-by: marcozabel <marco.zabel@dynatrace.com>
1 parent 2da34f5 commit 3a25c3c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/test/java/dev/openfeature/sdk/isolated/IsolatedAPITest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ void eventHandlerIsolation() throws Exception {
104104
api1.setProviderAndWait(new NoOpProvider());
105105

106106
assertThat(api1HandlerLatch.await(1, TimeUnit.SECONDS)).isTrue();
107+
108+
// Short delay to allow any (incorrect) async dispatch to api2 to land
109+
// before we assert the negative. Without this, a bug in isolation could
110+
// slip past if api2's handler fires just after the assertion.
111+
Thread.sleep(200);
107112
assertThat(api2HandlerCalled.get()).isFalse();
108113
}
109114

0 commit comments

Comments
 (0)