private void waitForNoMaster(List<Integer> nodes) {
        Instant endTime = Instant.now().plus(timeout());
        while (Instant.now().isBefore(endTime)) {
            boolean allOk = true;
            for (int node : nodes) {
                if (fleetControllers.get(node).isMaster()) {  // there is a master, we are waiting for no master
                    allOk = false;
                    break;
                }
            }
            if (allOk) return;
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) { /* ignore */ }
        }
        throw new IllegalStateException("Did not end up in state with no master within timeout of " + timeout());
    }
Should always write new version to ZooKeeper, even if the version will not
be published to any nodes. External services may still observe the version
number via the cluster REST API, and we should therefore ensure that we never
risk rolling back the version number in the face of a reelection.
clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/MasterElectionTest.java