mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 22:36:20 +00:00
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:
parent
ab0a0cd4d4
commit
920a21e55c
@ -40,7 +40,7 @@ public class EvilJNANativesTests extends ESTestCase {
|
|||||||
for (String line : lines) {
|
for (String line : lines) {
|
||||||
if (line != null && line.startsWith("Max processes")) {
|
if (line != null && line.startsWith("Max processes")) {
|
||||||
final String[] fields = line.split("\\s+");
|
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));
|
assertThat(JNANatives.MAX_NUMBER_OF_THREADS, equalTo(limit));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user