Skip to content

Commit 08ce1f5

Browse files
committed
update test
1 parent faedd48 commit 08ce1f5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

client/src/test/java/io/split/client/SplitFactoryImplTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import io.split.telemetry.storage.TelemetryStorage;
99
import io.split.telemetry.synchronizer.TelemetrySynchronizer;
1010
import junit.framework.TestCase;
11+
import org.awaitility.Awaitility;
1112
import org.junit.Assert;
1213
import org.junit.Ignore;
1314
import org.junit.Test;
@@ -23,6 +24,7 @@
2324
import java.lang.reflect.Method;
2425
import java.lang.reflect.Modifier;
2526
import java.net.URISyntaxException;
27+
import java.util.concurrent.TimeUnit;
2628

2729

2830
public class SplitFactoryImplTest extends TestCase {
@@ -197,7 +199,10 @@ public void testFactoryConsumerInstantiationRetryReadiness() throws Exception {
197199
splitFactoryImpl.set(splitFactory, userStorageWrapper);
198200
assertNotNull(splitFactory.client());
199201
assertNotNull(splitFactory.manager());
200-
Thread.sleep(2000);
202+
Awaitility.await()
203+
.atMost(5L, TimeUnit.SECONDS)
204+
.untilAsserted(() -> Assert.assertTrue(userStorageWrapper.connect()));
205+
201206
Mockito.verify(userStorageWrapper, Mockito.times(2)).connect();
202207
}
203208

0 commit comments

Comments
 (0)