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 package in syncutil tests.

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

#5232

Screenshots (if appropriate):

@akrem-chabchoub akrem-chabchoub self-assigned this Oct 29, 2025
@akrem-chabchoub akrem-chabchoub marked this pull request as ready for review October 29, 2025 07:13
Copilot AI review requested due to automatic review settings October 29, 2025 07:13
@akrem-chabchoub akrem-chabchoub added this to the v2.7.0 milestone Oct 29, 2025
Copy link
Contributor

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 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 TestWaitWithTimeout test logic in synctest.Test() to enable deterministic time simulation
  • Restricts CI test targets to only run tests in ./pkg/util/syncutil instead 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
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 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).

Copilot uses AI. Check for mistakes.
Makefile Outdated
$(GO) test -run "[^FLAKY]$$" -coverprofile=cover.out ./pkg/util/syncutil
else
$(GO) test -run "[^FLAKY]$$" ./...
$(GO) test -run "[^FLAKY]$$" ./pkg/util/syncutil
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 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).

Copilot uses AI. Check for mistakes.
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
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 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).

Copilot uses AI. Check for mistakes.
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
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 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).

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@acud acud left a 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

@akrem-chabchoub akrem-chabchoub merged commit 7980065 into master Nov 23, 2025
15 checks passed
@akrem-chabchoub akrem-chabchoub deleted the migrate-to-synctest-part2 branch November 23, 2025 21:50
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

5 participants