Skip to content

Commit

Permalink
SNOW-799391: Check only http connection timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dprzybysz committed Oct 22, 2024
1 parent 46e3b56 commit d0b16be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
import net.snowflake.common.core.SqlState;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.entity.StringEntity;
import org.junit.After;
import org.junit.Before;
Expand Down Expand Up @@ -1634,8 +1635,7 @@ public void shouldFailOnSslExceptionWithLinkToTroubleShootingGuide() throws Inte
fail("should fail");
} catch (SQLException e) {
// *.badssl.com may fail with timeout
if (!(e.getCause() instanceof SSLHandshakeException)
&& e.getCause().getMessage().toLowerCase().contains("timeout")) {
if (e.getCause() instanceof ConnectTimeoutException) {
return;
}
assertThat(e.getCause(), instanceOf(SSLHandshakeException.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import net.snowflake.client.category.TestCategoryConnection;
import net.snowflake.client.core.SFOCSPException;
import net.snowflake.client.core.SFTrustManager;
import org.apache.http.conn.ConnectTimeoutException;
import org.hamcrest.Matcher;
import org.junit.After;
import org.junit.Before;
Expand Down Expand Up @@ -419,9 +420,7 @@ public void testWrongHost() throws InterruptedException {
fail("should fail");
} catch (SQLException ex) {
// *.badssl.com may fail with timeout
if (!(ex.getCause() instanceof SSLPeerUnverifiedException)
&& !(ex.getCause() instanceof SSLHandshakeException)
&& ex.getCause().getMessage().toLowerCase().contains("timeout")) {
if (ex.getCause() instanceof ConnectTimeoutException) {
return;
}
assertThat(ex, instanceOf(SnowflakeSQLException.class));
Expand Down

0 comments on commit d0b16be

Please sign in to comment.