xtest.Context uses testing.TB.Context() as root context#2046
xtest.Context uses testing.TB.Context() as root context#2046asmyasnikov wants to merge 7 commits into
Conversation
summaryInferred base version: v3.135.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 75.09% 74.79% -0.31%
==========================================
Files 427 428 +1
Lines 36918 36920 +2
==========================================
- Hits 27723 27613 -110
- Misses 8005 8100 +95
- Partials 1190 1207 +17
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:
|
|
@copilot можешь посмотреть почему ломаются тесты если использовать контекст из testing.TB? И надо исправить тесты, т.к. использование контекста из testing.TB - правильное решение |
…ntext.Canceled error Agent-Logs-Url: https://github.com/ydb-platform/ydb-go-sdk/sessions/d0453070-4126-4859-8740-02d862d264c0 Co-authored-by: asmyasnikov <14202262+asmyasnikov@users.noreply.github.com>
The tests were failing because in Go 1.24, Fixed in commit Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
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