Commit 1b3006be by Jason Song

enlarge sleep interval for ut

parent 3e4ce84c
......@@ -330,7 +330,7 @@ public class NotificationControllerV2Test {
assertTrue(!anotherDeferredResult.hasResult());
TimeUnit.MILLISECONDS.sleep(someBatchInterval * 5);
TimeUnit.MILLISECONDS.sleep(someBatchInterval * 10);
assertTrue(anotherDeferredResult.hasResult());
}
......
......@@ -74,6 +74,8 @@ public class AppNamespaceServiceWithCacheTest {
String anotherPrivateNamespace = "anotherPrivateNamespace";
long anotherPrivateNamespaceId = 3;
int sleepInterval = scanInterval * 10;
AppNamespace somePrivateAppNamespace = assembleAppNamespace(somePrivateNamespaceId,
someAppId, somePrivateNamespace, false);
AppNamespace somePublicAppNamespace = assembleAppNamespace(somePublicNamespaceId,
......@@ -116,7 +118,7 @@ public class AppNamespaceServiceWithCacheTest {
somePublicNamespaceId))).thenReturn(Lists.newArrayList(somePrivateAppNamespace,
somePublicAppNamespace));
scanIntervalTimeUnit.sleep(scanInterval * 3);
scanIntervalTimeUnit.sleep(sleepInterval);
check(Lists.newArrayList(somePrivateAppNamespace), appNamespaceServiceWithCache
.findByAppIdAndNamespaces(someAppId, someAppIdNamespaces));
......@@ -131,7 +133,7 @@ public class AppNamespaceServiceWithCacheTest {
anotherPublicAppNamespace));
when(appNamespaceRepository.findAll(appNamespaceIds)).thenReturn(allAppNamespaces);
scanIntervalTimeUnit.sleep(scanInterval * 3);
scanIntervalTimeUnit.sleep(sleepInterval);
check(Lists.newArrayList(somePrivateAppNamespace, yetAnotherPrivateAppNamespace,
anotherPublicAppNamespace), appNamespaceServiceWithCache.findByAppIdAndNamespaces
......@@ -169,7 +171,7 @@ public class AppNamespaceServiceWithCacheTest {
when(appNamespaceRepository.findAll(appNamespaceIds)).thenReturn(Lists.newArrayList
(somePrivateAppNamespaceNew, yetAnotherPrivateAppNamespaceNew, somePublicAppNamespaceNew));
scanIntervalTimeUnit.sleep(scanInterval * 3);
scanIntervalTimeUnit.sleep(sleepInterval);
check(Collections.emptyList(), appNamespaceServiceWithCache
.findByAppIdAndNamespaces(someAppId, someAppIdNamespaces));
......
......@@ -177,7 +177,7 @@ public class ReleaseMessageServiceWithCacheTest {
when(releaseMessageRepository.findFirst500ByIdGreaterThanOrderByIdAsc(someMessageId)).thenReturn(Lists
.newArrayList(newMessage));
scanIntervalTimeUnit.sleep(scanInterval * 3);
scanIntervalTimeUnit.sleep(scanInterval * 10);
ReleaseMessage newLatestReleaseMsg =
releaseMessageServiceWithCache
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment