diff --git a/test/fixtures/cache-tests/results/apache.json b/test/fixtures/cache-tests/results/apache.json index 89072ab2633..86c732f6e36 100644 --- a/test/fixtures/cache-tests/results/apache.json +++ b/test/fixtures/cache-tests/results/apache.json @@ -100,7 +100,7 @@ "cdn-date-update-exceed": true, "cdn-expires-update-exceed": [ "Assertion", - "Response 2 header Expires is \"null\", not \"Tue, 21 Jan 2025 00:20:15 GMT\"" + "Response 2 header Expires is \"null\", not \"Wed, 29 Jan 2025 03:37:47 GMT\"" ], "cdn-fresh-cc-nostore": [ "Assertion", @@ -340,10 +340,7 @@ "headers-store-Cache-Control": true, "headers-store-Clear-Site-Data": true, "headers-store-Connection": true, - "headers-store-Content-Encoding": [ - "AbortError", - "This operation was aborted" - ], + "headers-store-Content-Encoding": true, "headers-store-Content-Foo": true, "headers-store-Content-Length": true, "headers-store-Content-Location": true, @@ -496,11 +493,11 @@ "other-cookie": true, "other-date-update": [ "Assertion", - "Response 2 header Date is \"Tue, 21 Jan 2025 00:20:09 GMT\", not \"Tue, 21 Jan 2025 00:20:06 GMT\"" + "Response 2 header Date is \"Wed, 29 Jan 2025 03:37:41 GMT\", not \"Wed, 29 Jan 2025 03:37:38 GMT\"" ], "other-date-update-expires": [ "Assertion", - "Response 2 header Date is \"Tue, 21 Jan 2025 00:20:09 GMT\", not \"Tue, 21 Jan 2025 00:20:06 GMT\"" + "Response 2 header Date is \"Wed, 29 Jan 2025 03:37:41 GMT\", not \"Wed, 29 Jan 2025 03:37:38 GMT\"" ], "other-date-update-expires-update": true, "other-fresh-content-disposition-attachment": true, @@ -565,17 +562,14 @@ "fetch failed" ], "stale-close-s-maxage=2": [ - "AbortError", - "This operation was aborted" - ], - "stale-sie-503": [ "TypeError", "fetch failed" ], - "stale-sie-close": [ + "stale-sie-503": [ "TypeError", "fetch failed" ], + "stale-sie-close": true, "stale-warning-become": [ "TypeError", "fetch failed" diff --git a/test/fixtures/cache-tests/results/nginx.json b/test/fixtures/cache-tests/results/nginx.json index 9b6614c0f1e..1f12ac9984e 100644 --- a/test/fixtures/cache-tests/results/nginx.json +++ b/test/fixtures/cache-tests/results/nginx.json @@ -136,8 +136,8 @@ "Response 2 comes from cache" ], "ccreq-ma1": [ - "AbortError", - "This operation was aborted" + "Assertion", + "Response 2 comes from cache" ], "ccreq-magreaterage": [ "Assertion", @@ -147,13 +147,10 @@ "Assertion", "Response 2 does not come from cache" ], - "ccreq-max-stale-age": [ - "AbortError", - "This operation was aborted" - ], + "ccreq-max-stale-age": true, "ccreq-min-fresh": [ - "AbortError", - "This operation was aborted" + "Assertion", + "Response 2 comes from cache" ], "ccreq-min-fresh-age": [ "Assertion", @@ -184,7 +181,7 @@ "cdn-date-update-exceed": true, "cdn-expires-update-exceed": [ "Assertion", - "Response 2 header Expires is \"null\", not \"Tue, 21 Jan 2025 00:19:03 GMT\"" + "Response 2 header Expires is \"null\", not \"Wed, 29 Jan 2025 03:36:49 GMT\"" ], "cdn-fresh-cc-nostore": [ "Assertion", @@ -251,7 +248,10 @@ "Response 2 Age header not present." ], "cdn-remove-header": true, - "conditional-304-etag": true, + "conditional-304-etag": [ + "AbortError", + "This operation was aborted" + ], "conditional-etag-forward": [ "Assertion", "Request 1 header If-None-Match is \"undefined\", not \"\"abcdef\"\"" @@ -273,10 +273,7 @@ "Assertion", "Request 2 header If-None-Match is \"abcdef\", not \"\"abcdef\"\"" ], - "conditional-etag-strong-respond": [ - "AbortError", - "This operation was aborted" - ], + "conditional-etag-strong-respond": true, "conditional-etag-strong-respond-multiple-first": true, "conditional-etag-strong-respond-multiple-last": true, "conditional-etag-strong-respond-multiple-second": true, @@ -649,11 +646,11 @@ "other-cookie": true, "other-date-update": [ "Assertion", - "Response 2 header Date is \"Tue, 21 Jan 2025 00:18:57 GMT\", not \"Tue, 21 Jan 2025 00:18:54 GMT\"" + "Response 2 header Date is \"Wed, 29 Jan 2025 03:36:43 GMT\", not \"Wed, 29 Jan 2025 03:36:40 GMT\"" ], "other-date-update-expires": [ "Assertion", - "Response 2 header Date is \"Tue, 21 Jan 2025 00:18:57 GMT\", not \"Tue, 21 Jan 2025 00:18:54 GMT\"" + "Response 2 header Date is \"Wed, 29 Jan 2025 03:36:43 GMT\", not \"Wed, 29 Jan 2025 03:36:40 GMT\"" ], "other-date-update-expires-update": true, "other-fresh-content-disposition-attachment": true, @@ -811,8 +808,8 @@ "vary-no-match": true, "vary-normalise-combine": true, "vary-normalise-lang-case": [ - "Assertion", - "Response 2 does not come from cache" + "AbortError", + "This operation was aborted" ], "vary-normalise-lang-order": [ "Assertion", @@ -841,12 +838,12 @@ ], "vary-syntax-star": true, "vary-syntax-star-foo": [ - "AbortError", - "This operation was aborted" + "Assertion", + "Response 2 comes from cache" ], "vary-syntax-star-star": [ - "AbortError", - "This operation was aborted" + "Assertion", + "Response 2 comes from cache" ], "vary-syntax-star-star-lines": true } diff --git a/test/fixtures/cache-tests/results/squid.json b/test/fixtures/cache-tests/results/squid.json index 0b3b23c5d41..906f12a9013 100644 --- a/test/fixtures/cache-tests/results/squid.json +++ b/test/fixtures/cache-tests/results/squid.json @@ -69,7 +69,10 @@ "ccreq-ma1": true, "ccreq-magreaterage": true, "ccreq-max-stale": true, - "ccreq-max-stale-age": true, + "ccreq-max-stale-age": [ + "Setup", + "Response 1 status is 409, not 200" + ], "ccreq-min-fresh": true, "ccreq-min-fresh-age": true, "ccreq-no-cache": true, @@ -91,7 +94,7 @@ "cdn-date-update-exceed": true, "cdn-expires-update-exceed": [ "Assertion", - "Response 2 header Expires is \"null\", not \"Tue, 21 Jan 2025 00:17:30 GMT\"" + "Response 2 header Expires is \"null\", not \"Mon, 03 Feb 2025 05:33:42 GMT\"" ], "cdn-fresh-cc-nostore": [ "Assertion", @@ -440,7 +443,10 @@ "invalidate-DELETE-failed": true, "invalidate-DELETE-location": true, "invalidate-M-SEARCH": true, - "invalidate-M-SEARCH-cl": true, + "invalidate-M-SEARCH-cl": [ + "TypeError", + "fetch failed" + ], "invalidate-M-SEARCH-failed": [ "Assertion", "Response 3 does not come from cache" @@ -528,22 +534,10 @@ "query-args-same": true, "stale-503": true, "stale-close": true, - "stale-close-must-revalidate": [ - "Assertion", - "Response 2 comes from cache" - ], - "stale-close-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "stale-close-proxy-revalidate": [ - "Assertion", - "Response 2 comes from cache" - ], - "stale-close-s-maxage=2": [ - "Assertion", - "Response 2 comes from cache" - ], + "stale-close-must-revalidate": true, + "stale-close-no-cache": true, + "stale-close-proxy-revalidate": true, + "stale-close-s-maxage=2": true, "stale-sie-503": true, "stale-sie-close": true, "stale-warning-become": [ diff --git a/test/fixtures/cache-tests/results/trafficserver.json b/test/fixtures/cache-tests/results/trafficserver.json index 52d3c18c6e3..c2112d1ad18 100644 --- a/test/fixtures/cache-tests/results/trafficserver.json +++ b/test/fixtures/cache-tests/results/trafficserver.json @@ -97,7 +97,7 @@ "cdn-date-update-exceed": true, "cdn-expires-update-exceed": [ "Assertion", - "Response 2 header Expires is \"null\", not \"Tue, 21 Jan 2025 00:21:39 GMT\"" + "Response 2 header Expires is \"null\", not \"Mon, 03 Feb 2025 05:35:20 GMT\"" ], "cdn-fresh-cc-nostore": [ "Assertion", @@ -469,8 +469,8 @@ "Response 2 status is 403, not 500" ], "invalidate-DELETE-location": [ - "Assertion", - "Response 3 comes from cache" + "Setup", + "Response 2 status is 403, not 200" ], "invalidate-M-SEARCH": [ "Assertion", @@ -570,22 +570,10 @@ "query-args-same": true, "stale-503": true, "stale-close": true, - "stale-close-must-revalidate": [ - "Assertion", - "Response 2 comes from cache" - ], - "stale-close-no-cache": [ - "Assertion", - "Response 2 comes from cache" - ], - "stale-close-proxy-revalidate": [ - "Assertion", - "Response 2 comes from cache" - ], - "stale-close-s-maxage=2": [ - "Assertion", - "Response 2 comes from cache" - ], + "stale-close-must-revalidate": true, + "stale-close-no-cache": true, + "stale-close-proxy-revalidate": true, + "stale-close-s-maxage=2": true, "stale-sie-503": true, "stale-sie-close": true, "stale-warning-become": true, diff --git a/test/fixtures/cache-tests/test-engine/client/test.mjs b/test/fixtures/cache-tests/test-engine/client/test.mjs index 9acaeea8538..56487a1135f 100644 --- a/test/fixtures/cache-tests/test-engine/client/test.mjs +++ b/test/fixtures/cache-tests/test-engine/client/test.mjs @@ -115,9 +115,11 @@ function checkResponse (test, requests, idx, response) { // check response status if ('expected_status' in reqConfig) { - assert(setupCheck(reqConfig, 'expected_status'), - response.status === reqConfig.expected_status, - `Response ${reqNum} status is ${response.status}, not ${reqConfig.expected_status}`) + if (reqConfig.expected_status !== null) { + assert(setupCheck(reqConfig, 'expected_status'), + response.status === reqConfig.expected_status, + `Response ${reqNum} status is ${response.status}, not ${reqConfig.expected_status}`) + } } else if ('response_status' in reqConfig) { assert(true, // response status is always setup response.status === reqConfig.response_status[0], diff --git a/test/fixtures/cache-tests/test-engine/lib/testsuite-schema.json b/test/fixtures/cache-tests/test-engine/lib/testsuite-schema.json index ad97cdda349..95294ff81a6 100644 --- a/test/fixtures/cache-tests/test-engine/lib/testsuite-schema.json +++ b/test/fixtures/cache-tests/test-engine/lib/testsuite-schema.json @@ -218,7 +218,14 @@ }, "expected_status": { "description": "Expected response status received by the client", - "$ref": "#/definitions/status-code" + "anyOf": [ + { + "$ref": "#/definitions/status-code" + }, + { + "type": "null" + } + ] }, "expected_request_headers": { "description": "Request headers to check for on the server", diff --git a/test/fixtures/cache-tests/tests/cc-request.mjs b/test/fixtures/cache-tests/tests/cc-request.mjs index 6a7d59c8483..4638b28ffdf 100644 --- a/test/fixtures/cache-tests/tests/cc-request.mjs +++ b/test/fixtures/cache-tests/tests/cc-request.mjs @@ -194,7 +194,7 @@ export default { { response_headers: [ ['Cache-Control', 'max-age=3600'], - ['ETag', utils.httpContent('abc')] + ['ETag', `"${utils.httpContent('abc')}"`] ], setup: true }, diff --git a/test/fixtures/cache-tests/tests/invalidation.mjs b/test/fixtures/cache-tests/tests/invalidation.mjs index 772e41adabf..8ed8c7e46ec 100644 --- a/test/fixtures/cache-tests/tests/invalidation.mjs +++ b/test/fixtures/cache-tests/tests/invalidation.mjs @@ -71,7 +71,7 @@ function checkLocationInvalidation (method) { location({ setup: true }), lclResponse({ - request_method: 'POST', + request_method: method, request_body: 'abc', setup: true }), location({ diff --git a/test/fixtures/cache-tests/tests/stale.mjs b/test/fixtures/cache-tests/tests/stale.mjs index 616966e3ce1..0714d212a2d 100644 --- a/test/fixtures/cache-tests/tests/stale.mjs +++ b/test/fixtures/cache-tests/tests/stale.mjs @@ -18,7 +18,9 @@ function makeStaleCheckCC (cc, sharedOnly, value) { }, { disconnect: true, - expected_type: 'not_cached' + expected_status: null, + check_body: false, + expected_response_headers_missing: ['server-request-count'] } ] }