Skip to content

Commit 750eb6e

Browse files
authored
Fix test for JDBC version check (#42139)
The testExceptionThrownOnIncompatibleVersions test simply requires that the randomly selected version is not equal to the current version. The previous implementation of this test would sometimes randomly select CURRENT.
1 parent 64e3f64 commit 750eb6e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/VersionParityTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
public class VersionParityTests extends WebServerTestCase {
2626

2727
public void testExceptionThrownOnIncompatibleVersions() throws IOException, SQLException {
28-
Version version = VersionUtils.randomPreviousCompatibleVersion(random(), Version.CURRENT);
28+
Version version = VersionUtils.randomVersionBetween(random(), null, VersionUtils.getPreviousVersion());
29+
logger.info("Checking exception is thrown for version {}", version);
2930
prepareRequest(version);
3031

3132
String url = JdbcConfiguration.URL_PREFIX + webServer().getHostName() + ":" + webServer().getPort();

0 commit comments

Comments
 (0)