private void doTestTaskDeadlineExceeded(boolean deferredActivation, String expectedMessage) throws Exception {
        FleetControllerOptions.Builder options = defaultOptions();
        options.setMaxDeferredTaskVersionWaitTime(Duration.ofSeconds(60));
        options.enableTwoPhaseClusterStateActivation(deferredActivation);
        options.setMaxDivergentNodesPrintedInTaskErrorMessages(10);
        RemoteTaskFixture fixture = createFixtureWith(options);

        MockTask task = fixture.scheduleVersionDependentTaskWithSideEffects();
        communicator.setShouldDeferDistributorClusterStateAcks(true);
        fixture.processScheduledTask();

        assertTrue(task.isInvoked());
        assertFalse(task.isCompleted());
        assertFalse(task.isDeadlineExceeded());
        timer.advanceTime(60_001);
        ctrl.tick();
        assertTrue(task.isCompleted());
        assertTrue(task.isDeadlineExceeded());
        // If we're not using two-phase activation for this test, all storage nodes have ACKed
        // the bundle, but the distributors are explicitly deferred. If we used two-phase activation,
        // all distributors and storage nodes will be listed here.
        assertEquals(expectedMessage, task.failure.getMessage());
    }
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