Skip to content

Conversation

@akrem-chabchoub
Copy link
Contributor

@akrem-chabchoub akrem-chabchoub commented Oct 29, 2025

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

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):

@akrem-chabchoub akrem-chabchoub marked this pull request as ready for review October 29, 2025 08:11
Copilot AI review requested due to automatic review settings October 29, 2025 08:11
@akrem-chabchoub akrem-chabchoub self-assigned this Oct 29, 2025
@akrem-chabchoub akrem-chabchoub changed the title Migrate to synctest storageincentives Add synctest in storage incentives Oct 29, 2025
Copy link

Copilot AI left a 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 removes t.Parallel() calls
  • Adds testing/synctest import to affected test files
  • Restricts CI test execution to ./pkg/storageincentives instead 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
Copy link

Copilot AI Oct 29, 2025

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.

Copilot uses AI. Check for mistakes.
test-ci-race:
ifdef cover
$(GO) test -race -run "[^FLAKY]$$" -coverprofile=cover.out ./...
$(GO) test -race -run "[^FLAKY]$$" -coverprofile=cover.out ./pkg/storageincentives
Copy link

Copilot AI Oct 29, 2025

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.

Copilot uses AI. Check for mistakes.
@akrem-chabchoub akrem-chabchoub added this to the v2.7.0 milestone Oct 29, 2025
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.

Use the new testing/synctest package from golang 1.25 in tests

2 participants