Skip to content

Commit 3eea11d

Browse files
committed
Wait for flush in both cases of testFailuresAreRetried
1 parent 93e94dc commit 3eea11d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/ExposureWriterTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,10 @@ void testFailuresAreRetried(boolean finallyFail) throws Exception {
212212
writer.init();
213213
writer.accept(buildExposure());
214214

215+
MILLISECONDS.sleep(500); // wait for a flush to happen
216+
ExposuresRequest found = findRequest(serviceName);
215217
if (finallyFail) {
216-
MILLISECONDS.sleep(500); // wait for a flush to happen
217-
assertNull(findRequest(serviceName), requests.toString());
218+
assertNull(found, requests.toString());
218219
} else {
219220
eventually(
220221
() -> assertNotNull(findRequest(serviceName), requests.toString()), TIMEOUT_MILLIS);

0 commit comments

Comments
 (0)