Skip to content

Commit b54b6fb

Browse files
SNOW-2338525: Fix Authentication test suite timeout issues (#2434)
1 parent f3173a4 commit b54b6fb

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

src/main/java/net/snowflake/client/core/HttpUtil.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ public class HttpUtil {
115115

116116
@SnowflakeJdbcInternalApi
117117
public static void reset() {
118+
setConnectionTimeout(DEFAULT_HTTP_CLIENT_CONNECTION_TIMEOUT_IN_MS);
119+
setSocketTimeout(DEFAULT_HTTP_CLIENT_SOCKET_TIMEOUT_IN_MS);
118120
httpClient.clear();
119121
httpClientWithoutDecompression.clear();
120122
httpClientRoutePlanner.clear();

src/test/java/net/snowflake/client/authentication/PrivateKeyAuthenticationExceptionHandlingTest.java renamed to src/test/java/net/snowflake/client/jdbc/PrivateKeyAuthenticationExceptionHandlingLatestIT.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.snowflake.client.authentication;
1+
package net.snowflake.client.jdbc;
22

33
import static org.hamcrest.CoreMatchers.is;
44
import static org.hamcrest.MatcherAssert.assertThat;
@@ -11,16 +11,15 @@
1111
import java.util.stream.Stream;
1212
import net.snowflake.client.AbstractDriverIT;
1313
import net.snowflake.client.category.TestTags;
14+
import net.snowflake.client.core.HttpUtil;
1415
import net.snowflake.client.core.SecurityUtil;
15-
import net.snowflake.client.jdbc.BaseJDBCTest;
16-
import net.snowflake.client.jdbc.ErrorCode;
17-
import net.snowflake.client.jdbc.SnowflakeSQLException;
16+
import org.junit.jupiter.api.AfterEach;
1817
import org.junit.jupiter.api.Tag;
1918
import org.junit.jupiter.params.ParameterizedTest;
2019
import org.junit.jupiter.params.provider.MethodSource;
2120

22-
@Tag(TestTags.AUTHENTICATION)
23-
public class PrivateKeyAuthenticationExceptionHandlingTest extends BaseJDBCTest {
21+
@Tag(TestTags.CONNECTION)
22+
public class PrivateKeyAuthenticationExceptionHandlingLatestIT {
2423

2524
static Stream<String> jwtTimeoutProvider() {
2625
return Stream.of("10", "100", null);
@@ -30,9 +29,14 @@ static Stream<String> timeOutSettings() {
3029
return Stream.of("HTTP_CLIENT_CONNECTION_TIMEOUT", "HTTP_CLIENT_SOCKET_TIMEOUT");
3130
}
3231

32+
@AfterEach
33+
void cleanup() {
34+
HttpUtil.reset();
35+
}
36+
3337
/**
3438
* Tests the authentication exception and retry JWT renew functionality when retrying login
35-
* requests. To run, update environment variables to use connect with JWT authentication.
39+
* requests
3640
*/
3741
@ParameterizedTest
3842
@MethodSource("jwtTimeoutProvider")

0 commit comments

Comments
 (0)