Skip to content
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

replace wait.WithTimeout(timeout) with wait.WithContext(ctx)) #463

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

weicongw
Copy link
Contributor

Issue #, if available:

Description of changes:

replace wait.WithTimeout(timeout) with wait.WithContext(ctx))

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@weicongw weicongw marked this pull request as ready for review July 31, 2024 01:09
@@ -50,6 +50,9 @@ func TestMain(m *testing.M) {
log.Fatalf("failed to initialize test environment: %v", err)
}
testenv = env.NewWithConfig(cfg)
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Minute)
Copy link
Contributor

Choose a reason for hiding this comment

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

this is a timeout for all suites? should we have a timeout per top-level suite like single, multi, etc so that we don't block all the tests if one hangs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Having a timeout per top-level suite is very similar to the the previous approach,.

// WithContext provides a way to configure a context that can be used to cancel the wait condition checks. This will enable
// end users to write test in cases where the max timeout is not really predictable or is a factor of a different
// configuration or event.

I think WithContext makes more sense, since some test takes longer than others, e.g. nccl test vs unit test

Copy link
Contributor

Choose a reason for hiding this comment

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

should use WithContext regardless, but i meant using a different context per suite

@Issacwww Issacwww merged commit 06374dd into aws:main Jul 31, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants