public boolean waitState(SlobrokState slobrokState) {
        int millis = 120 * 1000;
        for (int i = 0; i < millis && !Thread.currentThread().isInterrupted(); ++i) {
            boolean done = true;
            for (String pattern : slobrokState.getPatterns()) {
                List<Mirror.Entry> res = net.getMirror().lookup(pattern);
                if (res.size() != slobrokState.getCount(pattern)) {
                    done = false;
                }
            }
            if (done) {
                if (i > 50) log.log(Level.INFO, "waitState OK after "+i+" ms");
                return true;
            }
            if ((i % 1000) == 50) {
                log.log(Level.INFO, "waitState still waiting, "+i+" ms");
                var m = (Mirror) net.getMirror();
                m.dumpState();
            }
            try {
                Thread.sleep(1);
            }
            catch (InterruptedException e) {
                // ignore
            }
        }
        return false;
    }
Wait for a required slobrok state.

@param slobrokState the state to wait for
@return whether or not the required state was reached
messagebus/src/main/java/com/yahoo/messagebus/network/rpc/test/TestServer.java