Skip to content

Commit 1e5f653

Browse files
committed
Logging: Skip test if it'd fail
If we're running on a platform where we can't install syscall filters Elasticsearch logs a message before it reads the data directory to get the node name. Because that log message doesn't have a node name this test will fail. Since we mostly run the test on OSes where we *can* install the syscall filters we can fairly safely skip the test on OSes where we can't install the syscall filters. Closes #33540
1 parent b96c0c1 commit 1e5f653

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

qa/unconfigured-node-name/src/test/java/org/elasticsearch/unconfigured_node_name/NodeNameInLogsIT.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package org.elasticsearch.unconfigured_node_name;
2121

22+
import org.elasticsearch.bootstrap.BootstrapInfo;
2223
import org.elasticsearch.common.logging.NodeNameInLogsIntegTestCase;
2324

2425
import java.io.IOException;
@@ -32,6 +33,8 @@
3233
public class NodeNameInLogsIT extends NodeNameInLogsIntegTestCase {
3334
@Override
3435
protected BufferedReader openReader(Path logFile) throws IOException {
36+
assumeTrue("We log a line without the node name if we can't install the seccomp filters",
37+
BootstrapInfo.isSystemCallFilterInstalled());
3538
return AccessController.doPrivileged((PrivilegedAction<BufferedReader>) () -> {
3639
try {
3740
return Files.newBufferedReader(logFile, StandardCharsets.UTF_8);
@@ -40,4 +43,11 @@ protected BufferedReader openReader(Path logFile) throws IOException {
4043
}
4144
});
4245
}
46+
47+
public void testDummy() {
48+
/* Dummy test case so that when we run this test on a platform that
49+
* does not support our syscall filters and we skip the test above
50+
* we don't fail the entire test run because we skipped all the tests.
51+
*/
52+
}
4353
}

0 commit comments

Comments
 (0)