xtest.Context uses testing.TB.Context() as root context#2046
xtest.Context uses testing.TB.Context() as root context#2046asmyasnikov wants to merge 4 commits intomasterfrom
Conversation
summaryInferred base version: v3.127.6 |
There was a problem hiding this comment.
Pull request overview
Updates pkg/xtest.Context() to derive its root context from testing.TB.Context() (intended for Go 1.24+), so test cancellation/deadlines can propagate naturally into contexts created by xtest.
Changes:
- Switch
xtest.Context(t)to use acontextRoot(t)helper as the parent context. - Add Go-version-gated
contextRoot(t)implementations via build tags (go1.24/!go1.24).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/xtest/context.go | Uses contextRoot(t) instead of context.Background() when building the test context. |
| pkg/xtest/context_root_go1.24.go | Adds contextRoot(t) implementation for Go 1.24 builds. |
| pkg/xtest/context_root.go | Adds contextRoot(t) implementation for non-Go-1.24 builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2046 +/- ##
==========================================
- Coverage 74.30% 73.25% -1.05%
==========================================
Files 399 400 +1
Lines 35003 35005 +2
==========================================
- Hits 26008 25642 -366
- Misses 7867 8220 +353
- Partials 1128 1143 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Other information