From 67655a5ab846fbaab1d31427a6cb8ba2ed31e496 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 2 Apr 2019 17:55:21 -0400 Subject: [PATCH] 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. --- .../org/elasticsearch/bootstrap/BootstrapForTesting.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/framework/src/main/java/org/elasticsearch/bootstrap/BootstrapForTesting.java b/test/framework/src/main/java/org/elasticsearch/bootstrap/BootstrapForTesting.java index 1f934aa00b3b8..28170c827b3e9 100644 --- a/test/framework/src/main/java/org/elasticsearch/bootstrap/BootstrapForTesting.java +++ b/test/framework/src/main/java/org/elasticsearch/bootstrap/BootstrapForTesting.java @@ -20,9 +20,8 @@ package org.elasticsearch.bootstrap; import com.carrotsearch.randomizedtesting.RandomizedRunner; - -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.lucene.util.LuceneTestCase; import org.elasticsearch.common.Booleans; import org.elasticsearch.common.Strings; @@ -30,6 +29,7 @@ import org.elasticsearch.common.io.FileSystemUtils; import org.elasticsearch.common.io.PathUtils; import org.elasticsearch.common.network.IfConfig; +import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugins.PluginInfo; import org.elasticsearch.secure_sm.SecureSM; import org.junit.Assert; @@ -79,8 +79,10 @@ public class BootstrapForTesting { } // just like bootstrap, initialize natives, then SM + final boolean memoryLock = + BootstrapSettings.MEMORY_LOCK_SETTING.get(Settings.EMPTY); // use the default bootstrap.memory_lock setting final boolean systemCallFilter = Booleans.parseBoolean(System.getProperty("tests.system_call_filter", "true")); - Bootstrap.initializeNatives(javaTmpDir, true, systemCallFilter, true); + Bootstrap.initializeNatives(javaTmpDir, memoryLock, systemCallFilter, true); // initialize probes Bootstrap.initializeProbes();