Skip to content

Commit 52de436

Browse files
mnotclaude
andcommitted
Keep only Y2038-centred tests in the y2038 suite
The first pass moved every existing large-value test. The ones that aren't tied to the 32-bit signed limit go back to where they were, byte for byte: `max-age=99999999999`, the `Expires` in 2286, and the two `CDN-Cache-Control` tests. Still moved: `max-age` and `Age` at 2147483647 to 2147483649, and the `Expires` of 19 Jan 2038 03:14:08. Test ids and definitions are unchanged throughout. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 55a47e1 commit 52de436

4 files changed

Lines changed: 76 additions & 77 deletions

File tree

‎tests/cc-freshness.mjs‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,25 @@ export default
7272
}
7373
]
7474
},
75+
{
76+
name: 'An optimal HTTP cache reuses a response with `Cache-Control: max-age: 99999999999`',
77+
id: 'freshness-max-age-max-plus',
78+
kind: 'optimal',
79+
depends_on: ['freshness-none'],
80+
spec_anchors: ['cache-response-directive.max-age'],
81+
requests: [
82+
{
83+
response_headers: [
84+
['Cache-Control', 'max-age=99999999999']
85+
],
86+
setup: true,
87+
pause_after: true
88+
},
89+
{
90+
expected_type: 'cached'
91+
}
92+
]
93+
},
7594
{
7695
name: 'HTTP cache must not reuse a response when the `Age` header is greater than its `Cache-Control: max-age` freshness lifetime',
7796
id: 'freshness-max-age-age',

‎tests/cdn-cache-control.mjs‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,44 @@ export default
2424
}
2525
]
2626
},
27+
{
28+
name: 'An optimal CDN reuses a response with `CDN-Cache-Control: max-age: 2147483648`',
29+
id: 'cdn-max-age-max',
30+
kind: 'optimal',
31+
cdn_only: true,
32+
depends_on: ['freshness-none'],
33+
requests: [
34+
{
35+
response_headers: [
36+
['CDN-Cache-Control', 'max-age=2147483648', false]
37+
],
38+
setup: true,
39+
pause_after: true
40+
},
41+
{
42+
expected_type: 'cached'
43+
}
44+
]
45+
},
46+
{
47+
name: 'An optimal CDN reuses a response with `CDN-Cache-Control: max-age: 99999999999`',
48+
id: 'cdn-max-age-max-plus',
49+
kind: 'optimal',
50+
cdn_only: true,
51+
depends_on: ['freshness-none'],
52+
requests: [
53+
{
54+
response_headers: [
55+
['CDN-Cache-Control', 'max-age=99999999999', false]
56+
],
57+
setup: true,
58+
pause_after: true
59+
},
60+
{
61+
expected_type: 'cached'
62+
}
63+
]
64+
},
2765
{
2866
name: 'CDN must not reuse a response when the `Age` header is greater than its `CDN-Cache-Control: max-age` freshness lifetime',
2967
id: 'cdn-max-age-age',

‎tests/expires-parse.mjs‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,25 @@ export default
66
description: 'These tests check how caches parse the `Expires` response header.',
77
spec_anchors: ['field.expires'],
88
tests: [
9+
{
10+
name: 'An optimal HTTP cache reuses a response with an `Expires` that is far in the future',
11+
id: 'freshness-expires-far-future',
12+
kind: 'optimal',
13+
depends_on: ['freshness-expires-future'],
14+
requests: [
15+
{
16+
response_headers: [
17+
['Expires', 'Sat, 20 Nov 2286 17:46:39 GMT', false],
18+
['Date', 0]
19+
],
20+
setup: true,
21+
pause_after: true
22+
},
23+
{
24+
expected_type: 'cached'
25+
}
26+
]
27+
},
928
{
1029
name: 'An optimal HTTP cache reuses a response with a future `Expires` in obsolete RFC 850 format',
1130
id: 'freshness-expires-rfc850',

‎tests/y2038.mjs‎

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -259,25 +259,6 @@ tests.push({
259259
})
260260
maxAge('4294967295')
261261
maxAge('4294967296')
262-
tests.push({
263-
name: 'An optimal HTTP cache reuses a response with `Cache-Control: max-age: 99999999999`',
264-
id: 'freshness-max-age-max-plus',
265-
kind: 'optimal',
266-
depends_on: ['freshness-none'],
267-
spec_anchors: ['cache-response-directive.max-age'],
268-
requests: [
269-
{
270-
response_headers: [
271-
['Cache-Control', 'max-age=99999999999']
272-
],
273-
setup: true,
274-
pause_after: true
275-
},
276-
{
277-
expected_type: 'cached'
278-
}
279-
]
280-
})
281262
maxAge('9223372036854775807')
282263
maxAge('18446744073709551616')
283264
maxAge('9'.repeat(100))
@@ -287,45 +268,6 @@ for (const n of [
287268
'9223372036854775807', '18446744073709551616', '9'.repeat(100)
288269
]) sMaxAge(n)
289270

290-
tests.push({
291-
name: 'An optimal CDN reuses a response with `CDN-Cache-Control: max-age: 2147483648`',
292-
id: 'cdn-max-age-max',
293-
kind: 'optimal',
294-
cdn_only: true,
295-
depends_on: ['freshness-none'],
296-
requests: [
297-
{
298-
response_headers: [
299-
['CDN-Cache-Control', 'max-age=2147483648', false]
300-
],
301-
setup: true,
302-
pause_after: true
303-
},
304-
{
305-
expected_type: 'cached'
306-
}
307-
]
308-
})
309-
tests.push({
310-
name: 'An optimal CDN reuses a response with `CDN-Cache-Control: max-age: 99999999999`',
311-
id: 'cdn-max-age-max-plus',
312-
kind: 'optimal',
313-
cdn_only: true,
314-
depends_on: ['freshness-none'],
315-
requests: [
316-
{
317-
response_headers: [
318-
['CDN-Cache-Control', 'max-age=99999999999', false]
319-
],
320-
setup: true,
321-
pause_after: true
322-
},
323-
{
324-
expected_type: 'cached'
325-
}
326-
]
327-
})
328-
329271
for (const n of ['2147483648', '4294967296', '99999999999']) staleWhileRevalidate(n)
330272
for (const n of ['2147483648', '4294967296', '99999999999']) staleIfError(n)
331273

@@ -568,25 +510,6 @@ expiresFuture('round-year')
568510
expiresFuture('uint32-max')
569511
expiresFuture('uint32-max-plus-1')
570512
expiresFuture('int64-ns-max')
571-
tests.push({
572-
name: 'An optimal HTTP cache reuses a response with an `Expires` that is far in the future',
573-
id: 'freshness-expires-far-future',
574-
kind: 'optimal',
575-
depends_on: ['freshness-expires-future'],
576-
requests: [
577-
{
578-
response_headers: [
579-
['Expires', 'Sat, 20 Nov 2286 17:46:39 GMT', false],
580-
['Date', 0]
581-
],
582-
setup: true,
583-
pause_after: true
584-
},
585-
{
586-
expected_type: 'cached'
587-
}
588-
]
589-
})
590513
expiresFuture('http-date-max')
591514

592515
for (const name of ['int32-max', 'round-year', 'uint32-max']) futureDateExpiresLater(name)

0 commit comments

Comments
 (0)