@Test(expected = NodeAllocationException.class)
    public void allocation_should_fail_when_host_is_not_in_allocatable_state() {
        ProvisioningTester tester = new ProvisioningTester.Builder().zone(new Zone(Environment.prod, RegionName.from("us-east"))).flavorsConfig(flavorsConfig()).build();
        tester.makeProvisionedNodes(3, "host-small", NodeType.host, 32).forEach(node ->
                                                                                        tester.nodeRepository().nodes().fail(node.hostname(), Agent.system, getClass().getSimpleName()));

        ApplicationId application = ProvisioningTester.applicationId();
        tester.prepare(application, clusterSpec("myContent.t2.a2"), 2, 1, new NodeResources(1, 40, 100, 1));
    }
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