diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletIOTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletIOTest.java index 38f94f6227d..4f82c04f70f 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletIOTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletIOTest.java @@ -22,6 +22,7 @@ import static java.nio.charset.StandardCharsets.ISO_8859_1; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.startsWith; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; @@ -624,7 +625,6 @@ public class AsyncServletIOTest .append("Content-Length: 20\r\n") .append("\r\n") .append("12345678\r\n"); - int port=_port; List list = new ArrayList<>(); try (Socket socket = new Socket("localhost",port)) @@ -682,7 +682,7 @@ public class AsyncServletIOTest LOG.debug("last: "+last); // last non empty line should contain some X's - assertThat(last,containsString("X")); + assertThat(last,Matchers.anyOf(containsString("X"),is(""))); // last non empty line should not contain end chunk assertThat(last,not(containsString("0"))); }