Skip to content

stale-sie-503 is a duplicate of stale-sie-close and never sends a 503 #167

@mnot

Description

@mnot

Problem

stale-sie-503 is a behavioral duplicate of stale-sie-close — it never sends the 503 its name describes.

https://github.com/http-tests/cache-tests/blob/main/tests/stale.mjs#L131-L149

Its second request uses disconnect: true, identical to stale-sie-close directly above it:

{
  name: 'Does HTTP cache serve stale stored response when server sends `Cache-Control: stale-if-error` and subsequently a `503 Service Unavailable`?',
  id: 'stale-sie-503',
  ...
  requests: [
    { response_headers: [['Cache-Control', 'max-age=2, stale-if-error=60']], setup: true, pause_after: true },
    { disconnect: true, expected_type: 'cached' }   // <-- disconnects instead of returning 503
  ]
}

So the stale-if-error-on-error-status path (the whole point of this test, vs. the connection-close variant) is never exercised.

Suggested fix

Mirror the existing stale-503 test (https://github.com/http-tests/cache-tests/blob/main/tests/stale.mjs#L48-L61), which already has the right shape:

{
  response_status: [503, 'Service Unavailable'],
  expected_status: 200,
  expected_type: 'cached'
}

kind: 'check', so this won't produce a false failure — but as written the test measures nothing distinct from stale-sie-close.


Filed from an AI-assisted (Claude Code) review of the tests, with each finding verified by hand and reviewed by a human before filing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions