提交 202363b5 编写于 作者: 张乐 提交者: GitHub

Merge pull request #535 from nobodyiam/fix-ut

enlarge sleep interval for ut
......@@ -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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册