Skip to content

Commit

Permalink
enlarge sleep interval for ut
Browse files Browse the repository at this point in the history
  • Loading branch information
nobodyiam committed Feb 7, 2017
1 parent 3e4ce84 commit 1b3006b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public void testPollNotificationWithHandleMessageInBatch() throws Exception {

assertTrue(!anotherDeferredResult.hasResult());

TimeUnit.MILLISECONDS.sleep(someBatchInterval * 5);
TimeUnit.MILLISECONDS.sleep(someBatchInterval * 10);

assertTrue(anotherDeferredResult.hasResult());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public void testAppNamespace() throws Exception {
String anotherPrivateNamespace = "anotherPrivateNamespace";
long anotherPrivateNamespaceId = 3;

int sleepInterval = scanInterval * 10;

AppNamespace somePrivateAppNamespace = assembleAppNamespace(somePrivateNamespaceId,
someAppId, somePrivateNamespace, false);
AppNamespace somePublicAppNamespace = assembleAppNamespace(somePublicNamespaceId,
Expand Down Expand Up @@ -116,7 +118,7 @@ public void testAppNamespace() throws Exception {
somePublicNamespaceId))).thenReturn(Lists.newArrayList(somePrivateAppNamespace,
somePublicAppNamespace));

scanIntervalTimeUnit.sleep(scanInterval * 3);
scanIntervalTimeUnit.sleep(sleepInterval);

check(Lists.newArrayList(somePrivateAppNamespace), appNamespaceServiceWithCache
.findByAppIdAndNamespaces(someAppId, someAppIdNamespaces));
Expand All @@ -131,7 +133,7 @@ public void testAppNamespace() throws Exception {
anotherPublicAppNamespace));
when(appNamespaceRepository.findAll(appNamespaceIds)).thenReturn(allAppNamespaces);

scanIntervalTimeUnit.sleep(scanInterval * 3);
scanIntervalTimeUnit.sleep(sleepInterval);

check(Lists.newArrayList(somePrivateAppNamespace, yetAnotherPrivateAppNamespace,
anotherPublicAppNamespace), appNamespaceServiceWithCache.findByAppIdAndNamespaces
Expand Down Expand Up @@ -169,7 +171,7 @@ public void testAppNamespace() throws Exception {
when(appNamespaceRepository.findAll(appNamespaceIds)).thenReturn(Lists.newArrayList
(somePrivateAppNamespaceNew, yetAnotherPrivateAppNamespaceNew, somePublicAppNamespaceNew));

scanIntervalTimeUnit.sleep(scanInterval * 3);
scanIntervalTimeUnit.sleep(sleepInterval);

check(Collections.emptyList(), appNamespaceServiceWithCache
.findByAppIdAndNamespaces(someAppId, someAppIdNamespaces));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public void testNewReleaseMessagesBeforeHandleMessage() throws Exception {
when(releaseMessageRepository.findFirst500ByIdGreaterThanOrderByIdAsc(someMessageId)).thenReturn(Lists
.newArrayList(newMessage));

scanIntervalTimeUnit.sleep(scanInterval * 3);
scanIntervalTimeUnit.sleep(scanInterval * 10);

ReleaseMessage newLatestReleaseMsg =
releaseMessageServiceWithCache
Expand Down

0 comments on commit 1b3006b

Please sign in to comment.