Skip to content

test: strengthen panic assertions and add concurrent-panic coverage#14

Merged
min0625 merged 1 commit into
mainfrom
test/improve-panic-assertions
Jun 24, 2026
Merged

test: strengthen panic assertions and add concurrent-panic coverage#14
min0625 merged 1 commit into
mainfrom
test/improve-panic-assertions

Conversation

@min0625

@min0625 min0625 commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace if p := recover(); p != nil guards with require.NotNil so panic tests fail loudly when no panic is re-raised (previously a missing panic silently passed)
  • Add Test_Group_MultiplePanics in both packages to exercise the drop path when N goroutines panic concurrently — verifies no deadlock or race under -race
  • Add Test_New_NilContext in x/errgroup to cover the nil-context fallback in New(nil)
  • Add Test_exception_Nil as a white-box test (internal package) for the nil branch of exception()

Test plan

  • make check passes (tidy, lint, go test -race ./...)

🤖 Generated with Claude Code

Replace silent `if p != nil` guards with `require.NotNil` so tests fail
loudly when no panic is re-raised. Add Test_Group_MultiplePanics (both
packages) to exercise the drop path when goroutines panic concurrently,
Test_New_NilContext to cover the nil-context fallback in x/errgroup, and
Test_exception_Nil as a white-box check of the nil branch in exception().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@min0625 min0625 merged commit c24e136 into main Jun 24, 2026
6 checks passed
@min0625 min0625 deleted the test/improve-panic-assertions branch June 24, 2026 07:53
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