diff --git a/muted-tests.yml b/muted-tests.yml index d6ca9920c7394..e6e142c55ad89 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -397,9 +397,6 @@ tests: issue: https://github.com/elastic/elasticsearch/issues/121966 - class: org.elasticsearch.xpack.searchablesnapshots.hdfs.SecureHdfsSearchableSnapshotsIT issue: https://github.com/elastic/elasticsearch/issues/121967 -- class: org.elasticsearch.xpack.esql.parser.StatementParserTests - method: testInvalidJoinPatterns - issue: https://github.com/elastic/elasticsearch/issues/121968 - class: org.elasticsearch.smoketest.SmokeTestMultiNodeClientYamlTestSuiteIT method: test {yaml=update/100_synthetic_source/stored text} issue: https://github.com/elastic/elasticsearch/issues/121991 diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/IdentifierGenerator.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/IdentifierGenerator.java index 88dbcaebaa4d0..df8cacff67f44 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/IdentifierGenerator.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/IdentifierGenerator.java @@ -78,16 +78,17 @@ public static String randomIndexPattern(Feature... features) { index.insert(0, "-"); } - var pattern = maybeQuote(index.toString()); + var pattern = index.toString(); + if (pattern.contains("|")) { + pattern = quote(pattern); + } + pattern = maybeQuote(pattern); + if (canAdd(Features.CROSS_CLUSTER, features)) { var cluster = maybeQuote(randomIdentifier()); pattern = maybeQuote(cluster + ":" + pattern); } - if (pattern.contains("|") && pattern.contains("\"") == false) { - pattern = quote(pattern); - } - return pattern; }