Skip to content

Commit 6d09a10

Browse files
Fix UT failure
1 parent 5214c3d commit 6d09a10

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

x-pack/plugin/esql/qa/testFixtures/src/test/java/org/elasticsearch/xpack/esql/CsvTestsDataLoaderTests.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,18 @@
1111

1212
import java.net.ConnectException;
1313

14+
import static org.hamcrest.Matchers.instanceOf;
1415
import static org.hamcrest.Matchers.startsWith;
1516

1617
public class CsvTestsDataLoaderTests extends ESTestCase {
1718

1819
public void testCsvTestsDataLoaderExecution() {
19-
ConnectException ce = expectThrows(ConnectException.class, () -> CsvTestsDataLoader.main(new String[] {}));
20-
assertThat(ce.getMessage(), startsWith("Connection refused"));
20+
Throwable cause = expectThrows(AssertionError.class, () -> CsvTestsDataLoader.main(new String[] {}));
21+
// find the root cause
22+
while (cause.getCause() != null) {
23+
cause = cause.getCause();
24+
}
25+
assertThat(cause, instanceOf(ConnectException.class));
26+
assertThat(cause.getMessage(), startsWith("Connection refused"));
2127
}
2228
}

0 commit comments

Comments
 (0)