-
Notifications
You must be signed in to change notification settings - Fork 380
test(synctest): add synctest to syncutil test #5259
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
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.
Pull Request Overview
This PR updates the test suite for the syncutil package to use Go's testing/synctest package for more deterministic testing of time-dependent synchronization code. The changes narrow CI test scope to focus on the syncutil package.
- Wraps the
TestWaitWithTimeouttest logic insynctest.Test()to enable deterministic time simulation - Restricts CI test targets to only run tests in
./pkg/util/syncutilinstead of all packages
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| pkg/util/syncutil/syncutil_test.go | Adds testing/synctest import and wraps test logic in synctest.Test() for deterministic time-based testing |
| Makefile | Narrows test-ci and test-ci-race targets to only test the syncutil package |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Makefile
Outdated
| test-ci: | ||
| ifdef cover | ||
| $(GO) test -run "[^FLAKY]$$" -coverprofile=cover.out ./... | ||
| $(GO) test -run "[^FLAKY]$$" -coverprofile=cover.out ./pkg/util/syncutil |
Copilot
AI
Oct 29, 2025
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.
The test-ci target now only tests ./pkg/util/syncutil instead of ./.... This dramatically reduces CI test coverage to a single package. This appears to be a debugging/temporary change rather than an intentional scope reduction. If this is intentional, the change should be documented or the target renamed to reflect its limited scope (e.g., test-ci-syncutil).
Makefile
Outdated
| $(GO) test -run "[^FLAKY]$$" -coverprofile=cover.out ./pkg/util/syncutil | ||
| else | ||
| $(GO) test -run "[^FLAKY]$$" ./... | ||
| $(GO) test -run "[^FLAKY]$$" ./pkg/util/syncutil |
Copilot
AI
Oct 29, 2025
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.
The test-ci target now only tests ./pkg/util/syncutil instead of ./.... This dramatically reduces CI test coverage to a single package. This appears to be a debugging/temporary change rather than an intentional scope reduction. If this is intentional, the change should be documented or the target renamed to reflect its limited scope (e.g., test-ci-syncutil).
Makefile
Outdated
| test-ci-race: | ||
| ifdef cover | ||
| $(GO) test -race -run "[^FLAKY]$$" -coverprofile=cover.out ./... | ||
| $(GO) test -race -run "[^FLAKY]$$" -coverprofile=cover.out ./pkg/util/syncutil |
Copilot
AI
Oct 29, 2025
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.
The test-ci-race target now only tests ./pkg/util/syncutil instead of ./.... This dramatically reduces CI test coverage to a single package. This appears to be a debugging/temporary change rather than an intentional scope reduction. If this is intentional, the change should be documented or the target renamed to reflect its limited scope (e.g., test-ci-race-syncutil).
Makefile
Outdated
| $(GO) test -race -run "[^FLAKY]$$" -coverprofile=cover.out ./pkg/util/syncutil | ||
| else | ||
| $(GO) test -race -run "[^FLAKY]$$" ./... | ||
| $(GO) test -race -run "[^FLAKY]$$" ./pkg/util/syncutil |
Copilot
AI
Oct 29, 2025
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.
The test-ci-race target now only tests ./pkg/util/syncutil instead of ./.... This dramatically reduces CI test coverage to a single package. This appears to be a debugging/temporary change rather than an intentional scope reduction. If this is intentional, the change should be documented or the target renamed to reflect its limited scope (e.g., test-ci-race-syncutil).
acud
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.
please revert the Makefile changes, otherwise LGTM
Checklist
Description
Add
synctestpackage insyncutiltests.Open API Spec Version Changes (if applicable)
Motivation and Context (Optional)
Related Issue (Optional)
#5232
Screenshots (if appropriate):