Skip to content

Report what Hookdeck did when the retry test times out - #17

Open
garethx wants to merge 1 commit into
mainfrom
fix/live-retry-flake
Open

Report what Hookdeck did when the retry test times out#17
garethx wants to merge 1 commit into
mainfrom
fix/live-retry-flake

Conversation

@garethx

@garethx garethx commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

test/live/delivery.test.mjs → "a refused delivery is retried" fails
intermittently: roughly one full npm run test:live in four, and never when the
file runs on its own. It has failed on at least two unrelated pull requests.

Since test:live runs on every PR, that is a flake other people's work pays for.

Why this instruments rather than fixes

All the failure leaves behind is:

timed out waiting for a delivery containing "retry-n8n-live-…"

That is consistent with several different causes, which need different fixes:

  • the event was never created, because the edge refused the ingest
  • the event exists but is still queued
  • it was delivered against a connection hookdeck listen was no longer attached
    to — the node's own setup text warns that events delivered while no CLI session
    exists are not recorded against that connection at all
  • the retry rule was replaced or never applied

I have chased this three times on hypotheses and twice been wrong: first the CLI
health check reading a deliberate 503 as a dead origin (a real bug, fixed with
--no-healthcheck, but not this one), then an unchecked ingest response (also a
real bug, also fixed, also not this one). Both were worth fixing. Neither was the
cause, because I could not reproduce the failure on demand and was reasoning from
absence.

So this PR makes the failure state its own case. On timeout it now reports:

  • the event and its attempt triggers with response codes
  • whether the connection is paused or disabled
  • the rules actually in force
  • how many refusals the handler issued, and how many deliveries were recorded

What it does not do

It does not make the test pass more often, and deliberately does not add
retries or widen the timeout to hide it — masking a flake nobody understands is
how it becomes permanent. The next CI failure should be enough to fix it
properly.

Verified the instrumented test still passes: test/live/delivery.test.mjs 6/6.

This test fails intermittently — roughly one full run in four, never when the
file runs alone. `test:live` runs on every pull request, so it fails unrelated
work, and "timed out waiting for a delivery" is all the evidence that survives.

That message cannot distinguish an event that was never created, one still
queued, one delivered against a connection the CLI was no longer attached to, or
a retry rule that was replaced before it applied. Those have different fixes,
and guessing between them has already cost several rounds.

So the timeout now reports the event and its attempt triggers, the connection's
paused and disabled state, and the rules actually in force. It does not fix the
flake: it makes the next occurrence say what happened, in CI, without needing to
be reproduced afterwards.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

2 participants