Skip to content

Commit

Permalink
Test fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita committed Oct 6, 2017
1 parent d273cb8 commit 2a24ad8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -130,12 +130,12 @@ public void testCancelAndInterrupt() throws InterruptedException, ExecutionExcep
RExecutorFuture<?> future = executor.submit(new ScheduledLongRunnableTask("executed1"));
Thread.sleep(2000);
cancel(future);
assertThat(redisson.<Integer>getBucket("executed1").get()).isBetween(1000, Integer.MAX_VALUE);
assertThat(redisson.<Long>getBucket("executed1").get()).isBetween(1000L, Long.MAX_VALUE);

RExecutorFuture<?> futureAsync = executor.submitAsync(new ScheduledLongRunnableTask("executed2"));
Thread.sleep(2000);
assertThat(executor.cancelTask(futureAsync.getTaskId())).isTrue();
assertThat(redisson.<Integer>getBucket("executed2").get()).isBetween(1000, Integer.MAX_VALUE);
assertThat(redisson.<Long>getBucket("executed2").get()).isBetween(1000L, Long.MAX_VALUE);
}

@Test
Expand Down
Expand Up @@ -19,7 +19,7 @@ public ScheduledLongRunnableTask(String objectName) {

@Override
public void run() {
for (int i = 0; i < Long.MAX_VALUE; i++) {
for (long i = 0; i < Long.MAX_VALUE; i++) {
if (Thread.currentThread().isInterrupted()) {
System.out.println("interrupted " + i);
redisson.getBucket(objectName).set(i);
Expand Down

0 comments on commit 2a24ad8

Please sign in to comment.