From 8885b798177563d4beb5cef0cfd7b84583410c56 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 28 Dec 2022 18:18:09 -0600 Subject: [PATCH] Improve tests.config property thread safety (#5645) (#5654) Signed-off-by: Daniel Widdis (cherry picked from commit cc2b704d99653fe426014b0de0c9482d97288156) Signed-off-by: github-actions[bot] Signed-off-by: Daniel Widdis Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- .../java/org/opensearch/bootstrap/BootstrapForTesting.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/framework/src/main/java/org/opensearch/bootstrap/BootstrapForTesting.java b/test/framework/src/main/java/org/opensearch/bootstrap/BootstrapForTesting.java index 4f135f2d14a75..524362524bbde 100644 --- a/test/framework/src/main/java/org/opensearch/bootstrap/BootstrapForTesting.java +++ b/test/framework/src/main/java/org/opensearch/bootstrap/BootstrapForTesting.java @@ -130,8 +130,9 @@ public class BootstrapForTesting { // java.io.tmpdir FilePermissionUtils.addDirectoryPath(perms, "java.io.tmpdir", javaTmpDir, "read,readlink,write,delete", false); // custom test config file - if (Strings.hasLength(System.getProperty("tests.config"))) { - FilePermissionUtils.addSingleFilePath(perms, PathUtils.get(System.getProperty("tests.config")), "read,readlink"); + String testConfigFile = System.getProperty("tests.config"); + if (Strings.hasLength(testConfigFile)) { + FilePermissionUtils.addSingleFilePath(perms, PathUtils.get(testConfigFile), "read,readlink"); } // intellij hack: intellij test runner wants setIO and will // screw up all test logging without it!