@Test
    void synchronous_remote_task_is_completed_when_state_is_acked_by_cluster() throws Exception {
        RemoteTaskFixture fixture = createDefaultFixture();
        MockTask task = fixture.scheduleVersionDependentTaskWithSideEffects();

        assertTrue(task.isInvoked());
        assertFalse(task.isCompleted());
        communicator.setShouldDeferDistributorClusterStateAcks(true);

        fixture.processScheduledTask(); // New state generated, but not ACKed by nodes since we're deferring.
        assertFalse(task.isCompleted());

        fixture.sendPartialDeferredDistributorClusterStateAcks();
        assertFalse(task.isCompleted()); // Not yet acked by all nodes

        fixture.sendAllDeferredDistributorClusterStateAcks();
        assertTrue(task.isCompleted()); // Now finally acked by all nodes
    }
Class for testing states of all nodes. Will fail in constructor with
debug message on non-expected results.
clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java