Skip to content

test(nestjs): Fix flaky schedule instrumentation error tests - #25447

Draft
mydea wants to merge 1 commit into
developfrom
fix/nestjs-basic-interval-flaky
Draft

mydea wants to merge 1 commit into
developfrom
fix/nestjs-basic-interval-flaky

Conversation

@mydea

@mydea mydea commented Oct 16, 2026

Copy link
Copy Markdown
Member

The `@Interval` (and `@Cron`) handlers in `nestjs-basic` throw an identical error on every tick, and the `Dedupe` integration drops consecutive identical errors. Once earlier tests have killed the other erroring cron jobs, nothing interleaves, so only the first interval error is ever sent — often before the test starts listening — and `waitForError` times out.

`waitForError` now takes an optional `timestamp` (mirroring `waitForStreamedSpan`), and these tests pass `0` to match errors emitted since app startup.

🤖 Generated with Claude Code

The @Cron and @interval handlers throw the same error on every tick, so
the Dedupe integration drops all but the first one unless another error
is sent in between. Once the other erroring cron jobs are killed, that
first error can predate the test's listener and it times out. Allow
`waitForError` to look back like `waitForStreamedSpan` and use it here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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