diff options
author | Tor Brede Vekterli <vekterli@yahoo-inc.com> | 2017-09-11 16:02:18 +0200 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@yahoo-inc.com> | 2017-09-11 16:02:18 +0200 |
commit | 96d3f5543a9ec7926a30411e8ab0dcb34cc56eb8 (patch) | |
tree | aa8238435e639ceb365dedad5e205a3908a1f81c /clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java | |
parent | 93b82bf55a88fd049e4f384d3a50c5859adcaec2 (diff) |
Test multiple scheduled synchronous tasks
Diffstat (limited to 'clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java')
-rw-r--r-- | clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java index 24cecd4f5b6..a452a85c870 100644 --- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java +++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java @@ -1447,6 +1447,24 @@ public class StateChangeTest extends FleetControllerTest { } @Test + public void multiple_tasks_may_be_scheduled_and_answered_at_the_same_time() throws Exception { + RemoteTaskFixture fixture = createDefaultFixture(); + communicator.setShouldDeferDistributorClusterStateAcks(true); + + MockTask task1 = fixture.scheduleNonIdempotentVersionDependentTask(); + MockTask task2 = fixture.scheduleNonIdempotentVersionDependentTask(); + + fixture.processScheduledTask(); + assertFalse(task1.isCompleted()); + assertFalse(task2.isCompleted()); + + fixture.sendAllDeferredDistributorClusterStateAcks(); + + assertTrue(task1.isCompleted()); + assertTrue(task2.isCompleted()); + } + + @Test public void synchronous_task_immediately_failed_when_leadership_lost() throws Exception { FleetControllerOptions options = optionsWithZeroTransitionTime(); options.fleetControllerCount = 3; |