Fix parsing in test set max number of threads

This commit fixes a test bug in
EvilJNANativesTests#testSetMaximumNumberOfThreads. Namely, the test was
not checking whether or not the value from /proc/self/limits was equal
to "unlimited" before attempting to parse as a long. This commit fixes
that error.
This commit is contained in:
Jason Tedor 2016-08-07 12:50:15 -04:00
parent ab0a0cd4d4
commit 920a21e55c

View File

@ -40,7 +40,7 @@ public class EvilJNANativesTests extends ESTestCase {
for (String line : lines) {
if (line != null && line.startsWith("Max processes")) {
final String[] fields = line.split("\\s+");
final long limit = Long.parseLong(fields[2]);
final long limit = "unlimited".equals(fields[2]) ? JNACLibrary.RLIM_INFINITY : Long.parseLong(fields[2]);
assertThat(JNANatives.MAX_NUMBER_OF_THREADS, equalTo(limit));
return;
}