Skip to content

Commit b0a8acc

Browse files
authored
Merge branch 'main' into esql_test_another_Way
2 parents 77ae632 + b5e92db commit b0a8acc

File tree

81 files changed

+1175
-624
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1175
-624
lines changed

distribution/tools/server-cli/src/test/java/org/elasticsearch/server/cli/APMJvmOptionsTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import static org.mockito.Mockito.doReturn;
3939
import static org.mockito.Mockito.mock;
4040

41-
@ESTestCase.WithoutSecurityManager
4241
public class APMJvmOptionsTests extends ESTestCase {
4342

4443
private Path installDir;

distribution/tools/server-cli/src/test/java/org/elasticsearch/server/cli/JvmErgonomicsTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.elasticsearch.common.util.concurrent.EsExecutors;
1616
import org.elasticsearch.node.NodeRoleSettings;
1717
import org.elasticsearch.test.ESTestCase;
18-
import org.elasticsearch.test.ESTestCase.WithoutSecurityManager;
1918

2019
import java.io.IOException;
2120
import java.util.ArrayList;
@@ -41,7 +40,6 @@
4140
import static org.junit.Assert.assertTrue;
4241
import static org.junit.Assert.fail;
4342

44-
@WithoutSecurityManager
4543
@SuppressFileSystems("*")
4644
public class JvmErgonomicsTests extends ESTestCase {
4745

distribution/tools/server-cli/src/test/java/org/elasticsearch/server/cli/JvmOptionsParserTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.elasticsearch.core.IOUtils;
1616
import org.elasticsearch.core.Strings;
1717
import org.elasticsearch.test.ESTestCase;
18-
import org.elasticsearch.test.ESTestCase.WithoutSecurityManager;
1918
import org.junit.AfterClass;
2019
import org.junit.BeforeClass;
2120

@@ -43,7 +42,6 @@
4342
import static org.hamcrest.Matchers.hasSize;
4443
import static org.hamcrest.Matchers.not;
4544

46-
@WithoutSecurityManager
4745
@LuceneTestCase.SuppressFileSystems("*")
4846
public class JvmOptionsParserTests extends ESTestCase {
4947

distribution/tools/server-cli/src/test/java/org/elasticsearch/server/cli/MachineDependentHeapTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import org.elasticsearch.common.settings.Settings;
1313
import org.elasticsearch.test.ESTestCase;
14-
import org.elasticsearch.test.ESTestCase.WithoutSecurityManager;
1514
import org.hamcrest.Matcher;
1615

1716
import java.util.Collections;
@@ -21,7 +20,6 @@
2120
import static org.hamcrest.Matchers.empty;
2221

2322
// TODO: rework these tests to mock jvm option finder so they can run with security manager, no forking needed
24-
@WithoutSecurityManager
2523
public class MachineDependentHeapTests extends ESTestCase {
2624

2725
public void testDefaultHeapSize() throws Exception {

docs/changelog/126314.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 126314
2+
summary: Add refresh to synonyms put / delete APIs to wait for synonyms to be accessible and reload analyzers
3+
area: Analysis
4+
type: bug
5+
issues:
6+
- 121441

docs/changelog/126935.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 126935
2+
summary: Synonyms API - Add refresh parameter to check synonyms index and reload analyzers
3+
area: Analysis
4+
type: enhancement
5+
issues:
6+
- 121441

libs/cli/src/test/java/org/elasticsearch/cli/TerminalTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
package org.elasticsearch.cli;
1111

1212
import org.elasticsearch.test.ESTestCase;
13-
import org.elasticsearch.test.ESTestCase.WithoutSecurityManager;
1413

1514
import java.io.IOException;
1615
import java.io.OutputStream;
@@ -23,7 +22,6 @@
2322
import static org.mockito.Mockito.verify;
2423
import static org.mockito.Mockito.verifyNoMoreInteractions;
2524

26-
@WithoutSecurityManager
2725
public class TerminalTests extends ESTestCase {
2826

2927
public void testSystemTerminalIfRedirected() {

libs/entitlement/asm-provider/src/test/java/org/elasticsearch/entitlement/instrumentation/impl/InstrumentationServiceImplTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import static org.hamcrest.Matchers.equalTo;
2424
import static org.hamcrest.Matchers.hasEntry;
2525

26-
@ESTestCase.WithoutSecurityManager
2726
public class InstrumentationServiceImplTests extends ESTestCase {
2827

2928
final InstrumentationService instrumentationService = new InstrumentationServiceImpl();

libs/entitlement/asm-provider/src/test/java/org/elasticsearch/entitlement/instrumentation/impl/InstrumenterTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
* This tests {@link InstrumenterImpl} can instrument various method signatures
4040
* (e.g. overloaded methods, overloaded targets, multiple instrumentation, etc.)
4141
*/
42-
@ESTestCase.WithoutSecurityManager
4342
public class InstrumenterTests extends ESTestCase {
4443
private static final Logger logger = LogManager.getLogger(InstrumenterTests.class);
4544

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/FileAccessTree.java

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,15 @@ private FileAccessTree(FilesEntitlement filesEntitlement, PathLookup pathLookup,
258258
this.exclusivePaths = sortedExclusivePaths;
259259
this.readPaths = pruneSortedPaths(readPaths).toArray(new String[0]);
260260
this.writePaths = pruneSortedPaths(writePaths).toArray(new String[0]);
261+
262+
logger.debug(
263+
() -> Strings.format(
264+
"Created FileAccessTree with paths: exclusive [%s], read [%s], write [%s]",
265+
String.join(",", this.exclusivePaths),
266+
String.join(",", this.readPaths),
267+
String.join(",", this.writePaths)
268+
)
269+
);
261270
}
262271

263272
// package private for testing
@@ -305,11 +314,17 @@ public static FileAccessTree withoutExclusivePaths(
305314
}
306315

307316
public boolean canRead(Path path) {
308-
return checkPath(normalizePath(path), readPaths);
317+
var normalizedPath = normalizePath(path);
318+
var canRead = checkPath(normalizedPath, readPaths);
319+
logger.trace(() -> Strings.format("checking [%s] (normalized to [%s]) for read: %b", path, normalizedPath, canRead));
320+
return canRead;
309321
}
310322

311323
public boolean canWrite(Path path) {
312-
return checkPath(normalizePath(path), writePaths);
324+
var normalizedPath = normalizePath(path);
325+
var canWrite = checkPath(normalizedPath, writePaths);
326+
logger.trace(() -> Strings.format("checking [%s] (normalized to [%s]) for write: %b", path, normalizedPath, canWrite));
327+
return canWrite;
313328
}
314329

315330
/**
@@ -327,7 +342,6 @@ static String normalizePath(Path path) {
327342
}
328343

329344
private boolean checkPath(String path, String[] paths) {
330-
logger.trace(() -> Strings.format("checking [%s] against [%s]", path, String.join(",", paths)));
331345
if (paths.length == 0) {
332346
return false;
333347
}
@@ -345,8 +359,9 @@ private boolean checkPath(String path, String[] paths) {
345359
}
346360

347361
private static boolean isParent(String maybeParent, String path) {
348-
logger.trace(() -> Strings.format("checking isParent [%s] for [%s]", maybeParent, path));
349-
return path.startsWith(maybeParent) && path.startsWith(FILE_SEPARATOR, maybeParent.length());
362+
var isParent = path.startsWith(maybeParent) && path.startsWith(FILE_SEPARATOR, maybeParent.length());
363+
logger.trace(() -> Strings.format("checking isParent [%s] for [%s]: %b", maybeParent, path, isParent));
364+
return isParent;
350365
}
351366

352367
@Override

0 commit comments

Comments
 (0)