summaryrefslogtreecommitdiffstats
path: root/jdisc_http_service
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2021-02-23 14:26:56 +0100
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2021-02-23 14:26:56 +0100
commitd1badccf2056aba64fcf92687eaedaca24c94196 (patch)
treeaac5640208c7797834c1cae275dbb8409ac47f62 /jdisc_http_service
parent6fc352246f6e4df4aa0d399b5a02c45fea1c05b6 (diff)
Read/write race will produce different error message for TLSv1.3
Diffstat (limited to 'jdisc_http_service')
-rw-r--r--jdisc_http_service/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/jdisc_http_service/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java b/jdisc_http_service/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java
index 2658a9d6fdb..21a1bc88aae 100644
--- a/jdisc_http_service/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java
+++ b/jdisc_http_service/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java
@@ -44,6 +44,7 @@ import org.eclipse.jetty.client.ProxyProtocolClientConnectionFactory.V2;
import org.eclipse.jetty.client.api.ContentResponse;
import org.eclipse.jetty.server.handler.AbstractHandlerContainer;
import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.hamcrest.Matchers;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
@@ -102,6 +103,7 @@ import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
@@ -971,7 +973,8 @@ public class HttpServerTest {
} catch (SSLException e) {
// This exception is thrown if Apache httpclient's write thread detects the handshake failure before the read thread.
log.log(Level.WARNING, "Client failed to get a proper TLS handshake response: " + e.getMessage(), e);
- assertThat(e.getMessage(), containsString("readHandshakeRecord")); // Only ignore this specific ssl exception
+ // Only ignore a subset of exceptions
+ assertThat(e.getMessage(), anyOf(containsString("readHandshakeRecord"), containsString("Broken pipe")));
}
}