Skip to content

test(tracing): Print count and debug output in assertion helpers#1236

Merged
lcian merged 1 commit into
masterfrom
lcian/improve-test-assertion-messages
Jul 10, 2026
Merged

test(tracing): Print count and debug output in assertion helpers#1236
lcian merged 1 commit into
masterfrom
lcian/improve-test-assertion-messages

Conversation

@lcian

@lcian lcian commented Jul 10, 2026

Copy link
Copy Markdown
Member

I encountered the failing test described in #1112 again in https://github.com/getsentry/sentry-rust/actions/runs/29080836630/job/86323043895?pr=1214.
Given that that test failure could indicate a problem in the SDK, I'm making this change to the assertion helper to print more information, which will help understand what's going on.

Refs #1112
#skip-changelog

When get_and_assert_only_item fails, the panic message now includes
how many items were found and their Debug representation. This makes
flaky test failures easier to diagnose.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lcian lcian marked this pull request as ready for review July 10, 2026 09:04
@lcian lcian requested a review from a team as a code owner July 10, 2026 09:04

@szokeasaurusrex szokeasaurusrex 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.

Nice, thanks! This will be super helpful to debug the flakes

If you get any debug output from this, please post on the issue. We could also include a link to the flakiness issue in the specific test's output with a request to report any debug logs on that issue when the test flakes.

@lcian lcian merged commit 93b0c60 into master Jul 10, 2026
35 checks passed
@lcian lcian deleted the lcian/improve-test-assertion-messages branch July 10, 2026 10:26
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