-
Notifications
You must be signed in to change notification settings - Fork 379
Add synctest in storage incentives #5262
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
base: master
Are you sure you want to change the base?
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 migrates two test functions (TestSocMine and TestClose/TestPhaseCancel) in the storage incentives package to use Go 1.23's testing/synctest package for better control over concurrent test execution. Additionally, the Makefile's CI test targets have been temporarily narrowed to only run tests in the pkg/storageincentives package.
- Wraps test logic in
synctest.Test()and removest.Parallel()calls - Adds
testing/synctestimport to affected test files - Restricts CI test execution to
./pkg/storageincentivesinstead of./...
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/storageincentives/soc_mine_test.go | Wraps TestSocMine with synctest.Test and removes t.Parallel() |
| pkg/storageincentives/events_test.go | Wraps TestClose and TestPhaseCancel with synctest.Test and removes t.Parallel() |
| Makefile | Restricts test-ci and test-ci-race targets to only test pkg/storageincentives |
Comments suppressed due to low confidence (1)
pkg/storageincentives/soc_mine_test.go:27
- Corrected spelling of 'incestives' to 'incentives'.
// TestSocMine dumps a sample made out SOCs to upload for storage incestives
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| test-ci: | ||
| ifdef cover | ||
| $(GO) test -run "[^FLAKY]$$" -coverprofile=cover.out ./... | ||
| $(GO) test -run "[^FLAKY]$$" -coverprofile=cover.out ./pkg/storageincentives |
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 and test-ci-race targets have been changed from testing all packages (./...) to only testing ./pkg/storageincentives. This significantly reduces test coverage in CI and means tests in other packages (e.g., pkg/accounting, pkg/api, pkg/storer, etc.) will not run during CI. If this is intentional for testing the synctest migration, consider adding a comment explaining this is temporary, or restore the original ./... pattern if all migrations are complete.
| test-ci-race: | ||
| ifdef cover | ||
| $(GO) test -race -run "[^FLAKY]$$" -coverprofile=cover.out ./... | ||
| $(GO) test -race -run "[^FLAKY]$$" -coverprofile=cover.out ./pkg/storageincentives |
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 has been changed from testing all packages (./...) to only testing ./pkg/storageincentives. This significantly reduces test coverage in CI and means race detection will not run for tests in other packages. If this is intentional for testing the synctest migration, consider adding a comment explaining this is temporary, or restore the original ./... pattern if all migrations are complete.
Checklist
Description
Add synctest in storage incentives.
Remove parallel execution from tests (synctest).
Open API Spec Version Changes (if applicable)
Motivation and Context (Optional)
Related Issue (Optional)
#5232
Screenshots (if appropriate):