Skip to content

fix(test): skip unrelated envelopes in typed collectors - #1253

Merged
whatyouhide merged 1 commit into
masterfrom
cursor/skip-unrelated-envelopes-9014
Oct 23, 2026
Merged

whatyouhide merged 1 commit into
masterfrom
cursor/skip-unrelated-envelopes-9014

Conversation

@whatyouhide

@whatyouhide whatyouhide commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Description

master CI failed in phoenix_app because GET /transaction expected one Sentry transaction within 1000ms and got none. This is a flaky test.

collect_sentry_transactions/3 (and the other typed collectors) read the first N envelopes and then kept only the requested item type. A log, metric, or client-report envelope in front of the transaction "consumed" that slot, so the assertion reported a timeout even when the transaction had been sent.

With this PR, typed collectors now skip envelopes that do not contain the requested item. Those envelopes do not count toward expected_count.

collect_sentry_transactions/3 counted the first N envelopes, then
dropped any that were not transactions. A log, metric, or client
report ahead of the transaction made assert_sentry_transaction/2
report a timeout even when the transaction was sent. The same helper
pattern applied to events, logs, check-ins, and metrics.

Typed collectors now ignore envelopes that do not contain the
requested item. Those envelopes do not consume expected_count.

The traced-exception integration test no longer asks for two
envelopes to look past the exception event.

Co-Authored-By: Grok 4.7 <noreply@anthropic.com>
@whatyouhide
whatyouhide requested a review from solnic October 23, 2026 08:38
@whatyouhide
whatyouhide marked this pull request as ready for review October 23, 2026 08:38

@solnic solnic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@whatyouhide
whatyouhide merged commit f68212a into master Oct 23, 2026
14 checks passed
@whatyouhide
whatyouhide deleted the cursor/skip-unrelated-envelopes-9014 branch October 23, 2026 14:30
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