Merge pull request #15772 from jasontedor/test-cluster-service-no-timeout
Fix NPE in TestClusterService when waiting indefinitely
This commit is contained in:
commit
5226186a81
|
@ -184,9 +184,11 @@ public class TestClusterService implements ClusterService {
|
|||
if (threadPool == null) {
|
||||
throw new UnsupportedOperationException("TestClusterService wasn't initialized with a thread pool");
|
||||
}
|
||||
if (timeout != null) {
|
||||
NotifyTimeout notifyTimeout = new NotifyTimeout(listener, timeout);
|
||||
notifyTimeout.future = threadPool.schedule(timeout, ThreadPool.Names.GENERIC, notifyTimeout);
|
||||
onGoingTimeouts.add(notifyTimeout);
|
||||
}
|
||||
listeners.add(listener);
|
||||
listener.postAdded();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue