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

        // host suspends and goes down
        tester.nodeRepository.orchestrator().setNodeStatus(new HostName(downNode), HostStatus.ALLOWED_TO_BE_DOWN);
        tester.serviceMonitor.setHostDown(downNode);
        tester.runMaintainers();
        assertEquals(Node.State.active, tester.nodeRepository.nodes().node(downNode).get().state());

        // host resumes after 30m
        tester.clock.advance(Duration.ofMinutes(30));
        tester.nodeRepository.orchestrator().setNodeStatus(new HostName(downNode), HostStatus.NO_REMARKS);
        tester.runMaintainers();
        assertEquals(Node.State.active, tester.nodeRepository.nodes().node(downNode).get().state());

        // the host should fail 1h after resume, not when the node goes down. Verify this
        tester.clock.advance(Duration.ofMinutes(45));
        tester.runMaintainers();
        assertEquals(Node.State.active, tester.nodeRepository.nodes().node(downNode).get().state());
        tester.clock.advance(Duration.ofMinutes(30));
        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