Bad tests take too long

This commit is contained in:
Joakim Erdfelt 2017-02-02 19:28:16 -07:00
parent b7adae104b
commit 43c203b606
2 changed files with 8 additions and 5 deletions

View File

@ -92,7 +92,8 @@ public abstract class AbstractHttpTest
writer.write("\r\n");
writer.flush();
HttpTester.Response response = HttpTester.parseResponse(socket.getInputStream());
HttpTester.Input input = HttpTester.from(socket.getInputStream());
HttpTester.Response response = HttpTester.parseResponse(input);
if ("HTTP/1.1".equals(httpVersion)
&& response.get("content-length") == null
&& response.get("transfer-encoding") == null

View File

@ -429,10 +429,11 @@ public class HttpManyWaysToCommitTest extends AbstractHttpTest
try
{
HttpTester.Response response = executeRequest();
String failed_body = ""+(char)-1+(char)-1+(char)-1;
char badChar = (char) -1;
String failed_body = "" + badChar + badChar + badChar;
assertThat("response code", response.getStatus(), is(200));
assertThat(response.getContent(), endsWith(failed_body));
assertHeader(response, "content-length", "6");
assertThat(response.getContent(), endsWith(failed_body));
}
catch(EOFException e)
{
@ -449,10 +450,11 @@ public class HttpManyWaysToCommitTest extends AbstractHttpTest
try
{
HttpTester.Response response = executeRequest();
String failed_body = ""+(char)-1+(char)-1+(char)-1;
char badChar = (char) -1;
String failed_body = "" + badChar + badChar + badChar;
assertThat("response code is 200", response.getStatus(), is(200));
assertThat(response.getContent(), endsWith(failed_body));
assertHeader(response, "content-length", "6");
assertThat(response.getContent(), endsWith(failed_body));
}
catch(EOFException e)
{