Skip to content

Commit

Permalink
Merge pull request #237 from leonz/patch-1
Browse files Browse the repository at this point in the history
DeterministicScheduler: Future is done if cancelled
  • Loading branch information
olibye authored Mar 16, 2024
2 parents 589745f + 9988365 commit c44dfc0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ public int compareTo(Delayed o) {

public boolean cancel(boolean mayInterruptIfRunning) {
isCancelled = true;
isDone = true;
return deltaQueue.remove(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ public void testCanCancelScheduledCommands() {
assertFalse(future.isCancelled());
future.cancel(dontCare);
assertTrue(future.isCancelled());
assertTrue(future.isDone()); // fixes #

checking(new Expectations() {{
never (commandA);
Expand Down

0 comments on commit c44dfc0

Please sign in to comment.