diff --git a/testdata/request-parse-errors.php b/testdata/request-parse-errors.php index c6cc499be7..0f469978f5 100644 --- a/testdata/request-parse-errors.php +++ b/testdata/request-parse-errors.php @@ -16,6 +16,8 @@ if ($lastError && $lastError['type'] === E_WARNING) { http_response_code(400); echo $lastError['message']; + // The last error persists between requests like userland state + error_clear_last(); } ++$requests; diff --git a/worker_test.go b/worker_test.go index d0ace676f2..017de1eb79 100644 --- a/worker_test.go +++ b/worker_test.go @@ -68,7 +68,7 @@ func TestWorkerSurvivesRequestParseErrors(t *testing.T) { assert.Contains(t, body2, "requests:2") assert.Contains(t, body2, "exceeds the limit") - // clean request: recorded errors must be reset between requests + // clean request: the script cleared the previous error itself body3, resp3 := testGet("http://example.com/request-parse-errors.php", handler, t) assert.Equal(t, http.StatusOK, resp3.StatusCode) assert.Contains(t, body3, "requests:3")