Skip to content

Commit 003279d

Browse files
authored
Use default memory lock setting in testing (#40730)
Today we are running our internal tests with bootstrap.memory_lock enabled. This is not out default setting, and not the recommended value. This commit switches to use the default value, which is to not enable bootstrap.memory_lock.
1 parent b1e2cec commit 003279d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/framework/src/main/java/org/elasticsearch/bootstrap/BootstrapForTesting.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
package org.elasticsearch.bootstrap;
2121

2222
import com.carrotsearch.randomizedtesting.RandomizedRunner;
23-
24-
import org.apache.logging.log4j.Logger;
2523
import org.apache.logging.log4j.LogManager;
24+
import org.apache.logging.log4j.Logger;
2625
import org.apache.lucene.util.LuceneTestCase;
2726
import org.elasticsearch.common.Booleans;
2827
import org.elasticsearch.common.Strings;
2928
import org.elasticsearch.common.SuppressForbidden;
3029
import org.elasticsearch.common.io.FileSystemUtils;
3130
import org.elasticsearch.common.io.PathUtils;
3231
import org.elasticsearch.common.network.IfConfig;
32+
import org.elasticsearch.common.settings.Settings;
3333
import org.elasticsearch.plugins.PluginInfo;
3434
import org.elasticsearch.secure_sm.SecureSM;
3535
import org.junit.Assert;
@@ -79,8 +79,10 @@ public class BootstrapForTesting {
7979
}
8080

8181
// just like bootstrap, initialize natives, then SM
82+
final boolean memoryLock =
83+
BootstrapSettings.MEMORY_LOCK_SETTING.get(Settings.EMPTY); // use the default bootstrap.memory_lock setting
8284
final boolean systemCallFilter = Booleans.parseBoolean(System.getProperty("tests.system_call_filter", "true"));
83-
Bootstrap.initializeNatives(javaTmpDir, true, systemCallFilter, true);
85+
Bootstrap.initializeNatives(javaTmpDir, memoryLock, systemCallFilter, true);
8486

8587
// initialize probes
8688
Bootstrap.initializeProbes();

0 commit comments

Comments
 (0)