private void provisionFastAndSlowThenDeploy(NodeResources.DiskSpeed requestDiskSpeed, boolean expectNodeAllocationFailure) {
        ProvisioningTester tester = new ProvisioningTester.Builder().zone(new Zone(Environment.prod, RegionName.from("us-east"))).flavorsConfig(flavorsConfig()).build();
        tester.makeReadyNodes(2, new Flavor(new NodeResources(1, 8, 120, 1, NodeResources.DiskSpeed.fast)), NodeType.host, 10, true);
        tester.makeReadyNodes(2, new Flavor(new NodeResources(1, 8, 120, 1, NodeResources.DiskSpeed.slow)), NodeType.host, 10, true);
        tester.activateTenantHosts();

        ApplicationId application = ProvisioningTester.applicationId();
        ClusterSpec cluster = ClusterSpec.request(ClusterSpec.Type.container, ClusterSpec.Id.from("test")).vespaVersion("1").build();
        NodeResources resources = new NodeResources(1, 4, 100, 1, requestDiskSpeed);

        try {
            List<HostSpec> hosts = tester.prepare(application, cluster, 4, 1, resources);
            if (expectNodeAllocationFailure) fail("Expected node allocation fail");
            assertEquals(4, hosts.size());
            tester.activate(application, hosts);
        }
        catch (NodeAllocationException e) {
            if ( ! expectNodeAllocationFailure) throw e;
        }
    }
Test redeployment of nodes that violates spare headroom - but without alternatives
<p>
Setup 2 hosts and allocate one app with a container on each. 2 spares
<p>
Initial allocation of app 1 --> final allocation:
<p>
|    |    |        |    |    |
|    |    |   -->  |    |    |
| 1a | 1b |        | 1a | 1b |
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/DynamicAllocationTest.java