Skip to content

xtest.Context uses testing.TB.Context() as root context#2046

Open
asmyasnikov wants to merge 4 commits intomasterfrom
context-root
Open

xtest.Context uses testing.TB.Context() as root context#2046
asmyasnikov wants to merge 4 commits intomasterfrom
context-root

Conversation

@asmyasnikov
Copy link
Copy Markdown
Member

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Other information

@asmyasnikov asmyasnikov requested a review from Copilot March 17, 2026 07:27
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 17, 2026

summary

Inferred base version: v3.127.6
Suggested version: v3.127.7

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 a contextRoot(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-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.25%. Comparing base (5cd2f64) to head (279ea80).

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     
Flag Coverage Δ
experiment ?
go-1.21.x 73.18% <100.00%> (-0.05%) ⬇️
go-1.25.x 56.03% <100.00%> (-18.23%) ⬇️
integration 56.10% <100.00%> (+0.33%) ⬆️
macOS 47.73% <0.00%> (-0.07%) ⬇️
ubuntu 73.25% <100.00%> (-1.05%) ⬇️
unit 47.76% <0.00%> (-0.06%) ⬇️
windows 47.75% <0.00%> (-0.05%) ⬇️
ydb-24.4 55.13% <100.00%> (-0.09%) ⬇️
ydb-25.2 56.01% <100.00%> (+0.32%) ⬆️
ydb-latest 55.86% <100.00%> (+0.36%) ⬆️
ydb-nightly ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants