Skip to content

Fix Expires test dates; check for a mismatched weekday - #222

Merged
mnot merged 3 commits into
mainfrom
claude/expires-test-day-of-week-db4c65
Nov 4, 2026
Merged

mnot merged 3 commits into
mainfrom
claude/expires-test-day-of-week-db4c65

Conversation

@mnot

@mnot mnot commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Someone reported that one of the Expires tests uses a date whose day-of-week doesn't match, and that it throws an implementation off. This fixes that and a related slip, and adds a check for the behaviour itself.

  • Weekday fix. freshness-expires-ansi-c sent Thu Aug 8 02:01:18 2050, but 8 Aug 2050 is a Monday. It's now Mon. I checked every other weekday-prefixed date in tests/ and test-engine/ against a calendar; this was the only mismatch.
  • New check. freshness-expires-wrong-weekday (kind: 'check') sends Expires: Fri, 18 Aug 2050 02:01:18 GMT (a Thursday) and records whether the cache still reuses the response. The specification doesn't ask recipients to validate the day name, so this isn't a conformance test.
  • Timezone slip. freshness-expires-32bit used 14:14:08; 2^31 seconds is 03:14:08 GMT, so it wasn't hitting the 32-bit boundary. freshness-expires-far-future was 11 hours late in the same way (it's now 9999999999, Sat, 20 Nov 2286 17:46:39 GMT). Both weekdays/days updated to match.

npm run validate and npm run lint pass. I haven't run the changed tests against a cache, so results for existing caches may shift (the ansi-c fix in particular) and the new check hasn't been exercised.


AI-generated: Claude Code (Claude Sonnet 5.5) wrote these changes in an interactive session with Mark Nottingham, who pointed it at the asctime test and asked for the new check and the timezone fixes.

🤖 Generated with Claude Code

mnot and others added 3 commits November 4, 2026 20:19
freshness-expires-ansi-c sent "Thu Aug  8 02:01:18 2050", but 8 Aug 2050 is a
Monday (the Thursday is 18 Aug, which the other Expires tests use). A cache
that checks the day name against the date rejects the header, so the test
reports a failure that has nothing to do with asctime parsing.

Every other weekday-prefixed date in tests/ and test-engine/ matches its date;
this was the only one that didn't.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Some caches validate the day name against the date and discard the header
when they differ. The specification doesn't ask recipients to do that, so
this is a check, not a conformance test: it records whether a cache still
reuses a response with "Expires: Fri, 18 Aug 2050 02:01:18 GMT" (18 Aug 2050
is a Thursday).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Both values were 11 hours late, which looks like a timezone slip when they
were computed. 2^31 seconds is Tue, 19 Jan 2038 03:14:08 GMT, not 14:14:08,
so freshness-expires-32bit wasn't testing the 32-bit boundary. The far-future
value is 9999999999 (the largest ten-digit timestamp), Sat, 20 Nov 2286
17:46:39 GMT, not Sun, 21 Nov 04:46:39. Weekdays updated to match.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mnot
mnot merged commit 3ae67d5 into main Nov 4, 2026
2 checks passed
@mnot
mnot deleted the claude/expires-test-day-of-week-db4c65 branch November 4, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant