Skip to content

test: verify-strict 'dlqs envelope without outer signature' flakes on a file watch after the DLQ move #720

Closed

Description

@tps-flint

plugins/openclaw-tps-mail/test/verify-strict.test.ts > "dlqs envelope without outer signature" failed once in CI and passed on a re-run of the same commit (run 41763725690, job "Unit & Integration Tests", 2026-11-04). The failure line was preceded by error: ENOENT: no such file or directory, watch '<tmp>/anvil/new/2026-05-26T00-00-00-msg-….json': an fs.watch on a single message FILE that had already been moved out of new/.

The plugin's ingestion watches the new/ directory (src/index.ts ~2363), not files, so the file-level watch comes from somewhere else (a test helper, a mock, or a watcher leaking from an earlier test in the file).

What the fix does:

  • Finds the caller that watches the message file and removes the race: the test waits for the DLQ write deterministically (poll for the reason file with a bounded timeout) instead of a fixed 2 s race, and nothing watches a path the code under test moves.
  • Every watcher the file creates is closed in afterEach.

Test: run the file 50 times in a loop on CI's Bun; zero failures.

Activity

  1. moved this to Triage in Office queueon Nov 4, 2026
  2. self-assigned this
    on Nov 10, 2026
  3. moved this from Triage to In review in Office queueon Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions