@Test
    public void suspension_extends_grace_period() {
        NodeFailTester tester = NodeFailTester.withTwoApplications();
        String downNode = tester.nodeRepository.nodes().list(Node.State.active).owner(NodeFailTester.app1).asList().get(1).hostname();

        // host down, but within 1h timeout
        tester.serviceMonitor.setHostDown(downNode);
        tester.runMaintainers();
        assertEquals(Node.State.active, tester.nodeRepository.nodes().node(downNode).get().state());

        // 30m is still within 1h timeout
        tester.clock.advance(Duration.ofMinutes(30));
        tester.runMaintainers();
        assertEquals(Node.State.active, tester.nodeRepository.nodes().node(downNode).get().state());

        // suspend
        tester.clock.advance(Duration.ofSeconds(5));
        tester.nodeRepository.orchestrator().setNodeStatus(new HostName(downNode), HostStatus.ALLOWED_TO_BE_DOWN);
        tester.runMaintainers();
        assertEquals(Node.State.active, tester.nodeRepository.nodes().node(downNode).get().state());

        // the timeout should now be 4h, so still ~3:30 left.
        tester.clock.advance(Duration.ofHours(3));
        tester.runMaintainers();
        assertEquals(Node.State.active, tester.nodeRepository.nodes().node(downNode).get().state());

        // advancing another hour takes us beyond the 4h timeout
        tester.clock.advance(Duration.ofHours(1));
        tester.runMaintainers();
        assertEquals(Node.State.failed, tester.nodeRepository.nodes().node(downNode).get().state());
    }
Tests automatic failing of nodes.

@author bratseth
@author mpolden
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailerTest.java