Return null for "same" thread pool info

This commit modifes the EsThreadPoolTestCase#info helper method to
return null when info for the thread pool can not be found. This really
should only happen for the "same" thread pool, and so we also assert
that we only get to a place where there is no info if the thread pool
that info was requested for is in fact the "same" thread pool. Not
returning null here and instead throwing an exception would fail tests
that tried to lookup info on the "same" thread pool.
This commit is contained in:
Jason Tedor 2016-04-29 10:26:34 -04:00
parent 37382ecfb2
commit f349c4f135
1 changed files with 2 additions and 1 deletions

View File

@ -32,7 +32,8 @@ public abstract class ESThreadPoolTestCase extends ESTestCase {
return info;
}
}
throw new IllegalArgumentException(name);
assert "same".equals(name);
return null;
}
protected final ThreadPoolStats.Stats stats(final ThreadPool threadPool, final String name) {