Skip to content

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

Open
mydea wants to merge 2 commits into
developfrom
fix/nestjs-basic-interval-flaky
Open

mydea wants to merge 2 commits 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 threw 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.

The handlers now include Date.now() in the error message so every tick produces a distinct error, and the tests only accept an error thrown after the test started.

🤖 Generated with Claude Code

mydea and others added 2 commits October 16, 2026 13:19
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>
Include a timestamp in the thrown errors so the Dedupe integration never
drops them, and only accept errors thrown after the test started. This
reverts the `waitForError` timestamp option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mydea
mydea marked this pull request as ready for review October 19, 2026 08:29
@mydea
mydea requested review from JPeer264 and andreiborza October 19, 2026 08:29

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.now()

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.

2 participants