Skip to content

Conversation

@wongtonyb
Copy link
Collaborator

@wongtonyb wongtonyb commented Dec 30, 2025

Description

This PR updates the e2e tests to use t.Context() in replacement for context.Background() for the testing portion of the test.

t.Context() is ideal for the test execution portion, as it will auto cancel the context at the end of the test (on successful completion, failure, or timeout), but before any t.Cleanup functions.

Clean up functions, as well as any other functions that require explicit control over when to cancel (ie. goroutines) is required to use a new context with context.Background()

Jira Ticket: https://hashicorp.atlassian.net/browse/ICU-17222

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
  • If applicable, I've documented the impact of any changes to security controls.
    Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.

@wongtonyb wongtonyb added the pr/no-milestone Ignores the Milestone Check label Jan 6, 2026
@wongtonyb wongtonyb changed the title update context.Background() to t.Context() chore(e2e): update e2e tests to use t.Context() Jan 6, 2026
@wongtonyb wongtonyb requested a review from a team January 6, 2026 19:27
@wongtonyb wongtonyb marked this pull request as ready for review January 6, 2026 19:28
@wongtonyb wongtonyb requested a review from a team as a code owner January 6, 2026 19:28
irenarindos
irenarindos previously approved these changes Jan 6, 2026
Copy link
Collaborator

@irenarindos irenarindos left a comment

Choose a reason for hiding this comment

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

Looks good, though make-gen-delta is complaining with a formatting nit:
https://github.com/hashicorp/boundary/actions/runs/20756965352/job/59601550353?pr=6316

@moduli
Copy link
Collaborator

moduli commented Jan 6, 2026

Looks good, though make-gen-delta is complaining with a formatting nit: https://github.com/hashicorp/boundary/actions/runs/20756965352/job/59601550353?pr=6316

@irenarindos I think this was fixed in bo's pr that addresses flaky unit tests. @wongtonyb if you rebase with main, this should get resolved.

@wongtonyb wongtonyb merged commit 29ba92e into main Jan 6, 2026
61 of 62 checks passed
@wongtonyb wongtonyb deleted the wongtonyb-e2e-tests-tcontext branch January 6, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr/no-milestone Ignores the Milestone Check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants