@Override
    protected double maintain() {
        for (var nodeType : NodeType.values()) {
            if (!nodeType.isHost()) continue;
            boolean resume = canUpgradeOsOf(nodeType);
            nodeRepository().osVersions().resumeUpgradeOf(nodeType, resume);
        }
        return 1.0;
    }
@Test
    public void activates_upgrade() {
        var osVersions = tester.nodeRepository().osVersions();
        var osUpgradeActivator = new OsUpgradeActivator(tester.nodeRepository(), Duration.ofDays(1), new TestMetric());
        var version0 = Version.fromString("7.0");

        // Create infrastructure nodes
        var configHostNodes = tester.makeReadyNodes(3, "default", NodeType.confighost, 1);
        tester.prepareAndActivateInfraApplication(NodeType.confighost, version0);

        var tenantHostNodes = tester.makeReadyNodes(3, "default", NodeType.host, 1);
        tester.prepareAndActivateInfraApplication(NodeType.host, version0);
        tester.clock().advance(Duration.ofDays(1).plusSeconds(1)); // Let grace period pass

        var allNodes = new ArrayList<>(configHostNodes);
        allNodes.addAll(tenantHostNodes);

        // All nodes are on initial version
        assertEquals(version0, minWantedVersion(allNodes));
        completeUpgradeOf(configHostNodes);
        completeUpgradeOf(tenantHostNodes);
        assertEquals("All nodes are on initial version", version0, minCurrentVersion(allNodes));

        // New OS target version is set
        var osVersion0 = Version.fromString("8.0");
        osVersions.setTarget(NodeType.host, osVersion0, false);
        osVersions.setTarget(NodeType.confighost, osVersion0, false);

        // New OS version is activated as there is no ongoing Vespa upgrade
        osUpgradeActivator.maintain();
        assertTrue("OS version " + osVersion0 + " is active", osUpgradeActive(NodeType.confighost, NodeType.host));

        // Tenant hosts start upgrading to next Vespa version
        var version1 = Version.fromString("7.1");
        tester.prepareAndActivateInfraApplication(NodeType.host, version1);
        assertEquals("Wanted version of " + NodeType.host + " is raised", version1,
                     minWantedVersion(tenantHostNodes));

        // Activator pauses upgrade for tenant hosts only
        osUpgradeActivator.maintain();
        assertTrue("OS version " + osVersion0 + " is active", osUpgradeActive(NodeType.confighost));
        assertFalse("OS version " + osVersion0 + " is inactive", osUpgradeActive(NodeType.host));

        // One tenant host fails and is no longer considered
        tester.nodeRepository().nodes().fail(tenantHostNodes.get(0).hostname(), Agent.system, this.getClass().getSimpleName());

        // Remaining hosts complete their Vespa upgrade
        var healthyTenantHostNodes = tenantHostNodes.subList(1, tenantHostNodes.size());
        completeUpgradeOf(healthyTenantHostNodes);
        assertEquals("Tenant hosts upgraded", version1, minCurrentVersion(healthyTenantHostNodes));

        // Activator resumes OS upgrade of tenant hosts
        osUpgradeActivator.run();
        assertTrue("OS version " + osVersion0 + " is active", osUpgradeActive(NodeType.confighost, NodeType.host));
    }