-
Notifications
You must be signed in to change notification settings - Fork 303
chore(e2e): update e2e tests to use t.Context() #6316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
irenarindos
left a comment
There was a problem hiding this 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
@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. |
Description
This PR updates the e2e tests to use
t.Context()in replacement forcontext.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 anyt.Cleanupfunctions.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
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.