Skip to content

Commit f2d972d

Browse files
authored
FollowUp: Retry annotation should work on class level (opensearch-project#4091)
* FollowUp: Retry annotation should work on class level Signed-off-by: Lantao Jin <ltjin@amazon.com> * Ignore testQ7 in macOS Signed-off-by: Lantao Jin <ltjin@amazon.com> --------- Signed-off-by: Lantao Jin <ltjin@amazon.com>
1 parent 0398f68 commit f2d972d

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

integ-test/src/test/java/org/opensearch/sql/calcite/tpch/CalcitePPLTpchIT.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
import static org.opensearch.sql.util.MatcherUtils.verifySchemaInOrder;
1515

1616
import java.io.IOException;
17+
import java.util.Locale;
1718
import org.json.JSONObject;
19+
import org.junit.Assume;
1820
import org.junit.Ignore;
1921
import org.junit.Test;
2022
import org.opensearch.sql.ppl.PPLIntegTestCase;
@@ -176,6 +178,8 @@ public void testQ6() throws IOException {
176178

177179
@Test
178180
public void testQ7() throws IOException {
181+
String osName = System.getProperty("os.name").toLowerCase(Locale.ROOT);
182+
Assume.assumeFalse("testQ7 on macOS CI could socket timeout", osName.contains("mac"));
179183
String ppl = sanitize(loadFromFile("tpch/queries/q7.ppl"));
180184
JSONObject actual = executeQuery(ppl);
181185
verifySchemaInOrder(

integ-test/src/test/java/org/opensearch/sql/util/RetryProcessor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package org.opensearch.sql.util;
77

8+
import java.util.Optional;
89
import org.apache.logging.log4j.LogManager;
910
import org.apache.logging.log4j.Logger;
1011
import org.junit.rules.TestWatcher;
@@ -17,7 +18,9 @@ public class RetryProcessor extends TestWatcher {
1718

1819
@Override
1920
public Statement apply(Statement base, Description description) {
20-
Retry retry = description.getAnnotation(Retry.class);
21+
Retry retry =
22+
Optional.ofNullable(description.getAnnotation(Retry.class))
23+
.orElseGet(() -> description.getTestClass().getAnnotation(Retry.class));
2124
if (retry == null) {
2225
return base;
2326
}

0 commit comments

Comments
 (0)