Five DM/inbox/gift-wrap test files fail intermittently under full-suite load (pre-existing on dev) #70

Open
opened 2026-07-30 21:20:33 +00:00 by laoc · 0 comments
Owner

Five DM/inbox/gift-wrap test files fail intermittently under full-suite parallel load, on dev itself. Found while verifying #64; not caused by that branch — reproduced on unmodified dev.

The files

src/lib/__tests__/dm-recipient-relays.test.js
src/lib/__tests__/gift-wrap-publish.test.js
src/lib/__tests__/services/inbox-prefetch.test.js
src/lib/__tests__/services/inbox-read-tracking.test.js
src/lib/__tests__/services/inbox-service.test.js

Typical failures — all timeouts, not assertion mismatches:

× loads kind 10050 and 10002 for a recipient not yet in the store   5022ms
× publishes only to the relays resolved by the action               5025ms
× creates combined filter array with #p and #P                     30019ms
× extracts address pointer from reaction with a-tag                30023ms
× adds event ID to read set and persists to localStorage           30024ms

src/routes/api/pdf/__tests__/server.test.js and .../pdf-thumbnail/... join the set under heavier load (5031ms, 5002ms).

Evidence it is dev, not a branch

Two full-suite runs on a clean detached worktree at dev (aa4a129a):

run result
1 470 passed (470) / 5193 passed (5193), exit 0
2 5 failed | 465 passed, 6 failed | 5187 passed, exit 1 — exactly the five files above

Same commit, same machine, same command, opposite outcomes.

Why this is worth an issue

  1. It made me misdiagnose my own branch. I ran dev once (green), then my branch (red), and concluded I had introduced a regression. I spent a full bisect on it — stashing, a lazy-import rewrite — before a second dev run showed the same five red. One reading of a flaky suite is not a baseline.
  2. CI will read it as a real failure. pnpm test exits 1. Combined with the known GlobalFAB EnvironmentTeardownError flake (which also exits non-zero while every test passes), the suite currently has two independent ways to report red without a real defect.

Suspected shape

The failures are 5s/30s timeouts concentrated in files that mock relay/pool infrastructure and await network-shaped promises. Timing-sensitive under CPU contention rather than logically wrong — consistent with fake timers, real setTimeout, or unresolved promises that only settle when the event loop is not starved. Not diagnosed.

Not established

  • Which specific await in each file times out.
  • Whether one root cause covers all five files or they merely share a trigger.
  • Whether it reproduces in CI or only on a loaded dev machine.
Five DM/inbox/gift-wrap test files fail intermittently under full-suite parallel load, on `dev` itself. Found while verifying #64; **not caused by that branch** — reproduced on unmodified `dev`. ## The files ``` src/lib/__tests__/dm-recipient-relays.test.js src/lib/__tests__/gift-wrap-publish.test.js src/lib/__tests__/services/inbox-prefetch.test.js src/lib/__tests__/services/inbox-read-tracking.test.js src/lib/__tests__/services/inbox-service.test.js ``` Typical failures — all **timeouts**, not assertion mismatches: ``` × loads kind 10050 and 10002 for a recipient not yet in the store 5022ms × publishes only to the relays resolved by the action 5025ms × creates combined filter array with #p and #P 30019ms × extracts address pointer from reaction with a-tag 30023ms × adds event ID to read set and persists to localStorage 30024ms ``` `src/routes/api/pdf/__tests__/server.test.js` and `.../pdf-thumbnail/...` join the set under heavier load (5031ms, 5002ms). ## Evidence it is `dev`, not a branch Two full-suite runs on a clean detached worktree at `dev` (`aa4a129a`): | run | result | |---|---| | 1 | `470 passed (470)` / `5193 passed (5193)`, exit 0 | | 2 | `5 failed \| 465 passed`, `6 failed \| 5187 passed`, exit 1 — **exactly the five files above** | Same commit, same machine, same command, opposite outcomes. ## Why this is worth an issue 1. **It made me misdiagnose my own branch.** I ran `dev` once (green), then my branch (red), and concluded I had introduced a regression. I spent a full bisect on it — stashing, a lazy-import rewrite — before a second `dev` run showed the same five red. One reading of a flaky suite is not a baseline. 2. **CI will read it as a real failure.** `pnpm test` exits 1. Combined with the known `GlobalFAB` `EnvironmentTeardownError` flake (which also exits non-zero while every test passes), the suite currently has two independent ways to report red without a real defect. ## Suspected shape The failures are 5s/30s timeouts concentrated in files that mock relay/pool infrastructure and await network-shaped promises. Timing-sensitive under CPU contention rather than logically wrong — consistent with fake timers, real `setTimeout`, or unresolved promises that only settle when the event loop is not starved. Not diagnosed. ## Not established - Which specific await in each file times out. - Whether one root cause covers all five files or they merely share a trigger. - Whether it reproduces in CI or only on a loaded dev machine.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
edufeed/edufeed-app#70
No description provided.