File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
client/src/test/java/io/split/client Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 8
8
import io .split .telemetry .storage .TelemetryStorage ;
9
9
import io .split .telemetry .synchronizer .TelemetrySynchronizer ;
10
10
import junit .framework .TestCase ;
11
+ import org .awaitility .Awaitility ;
11
12
import org .junit .Assert ;
12
13
import org .junit .Ignore ;
13
14
import org .junit .Test ;
23
24
import java .lang .reflect .Method ;
24
25
import java .lang .reflect .Modifier ;
25
26
import java .net .URISyntaxException ;
27
+ import java .util .concurrent .TimeUnit ;
26
28
27
29
28
30
public class SplitFactoryImplTest extends TestCase {
@@ -197,7 +199,10 @@ public void testFactoryConsumerInstantiationRetryReadiness() throws Exception {
197
199
splitFactoryImpl .set (splitFactory , userStorageWrapper );
198
200
assertNotNull (splitFactory .client ());
199
201
assertNotNull (splitFactory .manager ());
200
- Thread .sleep (2000 );
202
+ Awaitility .await ()
203
+ .atMost (5L , TimeUnit .SECONDS )
204
+ .untilAsserted (() -> Assert .assertTrue (userStorageWrapper .connect ()));
205
+
201
206
Mockito .verify (userStorageWrapper , Mockito .times (2 )).connect ();
202
207
}
203
208
You can’t perform that action at this time.
0 commit comments