Skip to content

Commit

Permalink
revert timeout to 2s
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilal Al committed Sep 5, 2024
1 parent da16ffb commit 354c345
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion client/src/test/java/io/split/client/SplitFactoryImplTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URISyntaxException;

import java.util.HashMap;
import java.util.Map;

Expand All @@ -41,6 +42,10 @@
import okhttp3.logging.HttpLoggingInterceptor;
import okhttp3.Interceptor;

import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;

import static org.awaitility.Awaitility.await;
import static org.mockito.Mockito.when;

@RunWith(PowerMockRunner.class)
Expand Down Expand Up @@ -217,10 +222,24 @@ public void testFactoryConsumerInstantiationRetryReadiness() throws Exception {
splitFactoryImpl.set(splitFactory, userStorageWrapper);
assertNotNull(splitFactory.client());
assertNotNull(splitFactory.manager());
Thread.sleep(2500);
// await().atMost(3, TimeUnit.SECONDS).until(didTheThing(userStorageWrapper));
Thread.sleep(2000);
Mockito.verify(userStorageWrapper, Mockito.times(2)).connect();
}

/*
private Callable<Boolean> didTheThing(UserStorageWrapper userStorageWrapper) {
return new Callable<Boolean>() {
public Boolean call() throws Exception {
while (!Mockito.verify(userStorageWrapper, Mockito.times(2)).connect()) {
Thread.sleep(3000);
}
return true;
}
};
}
*/

@Test
public void testFactoryConsumerDestroy() throws NoSuchFieldException, URISyntaxException, IllegalAccessException {
CustomStorageWrapper customStorageWrapper = Mockito.mock(CustomStorageWrapper.class);
Expand Down

0 comments on commit 354c345

Please sign in to comment.