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 evict test.

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:14
Copilot AI review requested due to automatic review settings October 29, 2025 08:14
@akrem-chabchoub akrem-chabchoub added this to the v2.7.0 milestone Oct 29, 2025
@akrem-chabchoub akrem-chabchoub self-assigned this 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 refactors the TestEvict function to use synctest.Test instead of running in parallel, likely to enable deterministic testing of time-dependent behavior. The Makefile is temporarily modified to run only the reserve package tests.

  • Replaced t.Parallel() with synctest.Test() wrapper in TestEvict
  • Wrapped the entire test body in a function closure passed to synctest.Test
  • Temporarily narrowed test-ci targets to only test the reserve package

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
pkg/storer/internal/reserve/reserve_test.go Refactored TestEvict to use synctest.Test for controlled time execution
Makefile Temporarily restricted test-ci and test-ci-race targets to only run reserve package tests

💡 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/storer/internal/reserve/
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 targets are temporarily restricted to only run ./pkg/storer/internal/reserve/ tests instead of the full test suite (./...). This appears to be a temporary debugging/development change that should not be committed. These targets should test the entire codebase in CI.

Copilot uses AI. Check for mistakes.
Makefile Outdated
$(GO) test -run "[^FLAKY]$$" -coverprofile=cover.out ./pkg/storer/internal/reserve/
else
$(GO) test -run "[^FLAKY]$$" ./...
$(GO) test -run "[^FLAKY]$$" ./pkg/storer/internal/reserve/
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 targets are temporarily restricted to only run ./pkg/storer/internal/reserve/ tests instead of the full test suite (./...). This appears to be a temporary debugging/development change that should not be committed. These targets should test the entire codebase in CI.

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/storer/internal/reserve/
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 targets are temporarily restricted to only run ./pkg/storer/internal/reserve/ tests instead of the full test suite (./...). This appears to be a temporary debugging/development change that should not be committed. These targets should test the entire codebase in CI.

Copilot uses AI. Check for mistakes.
Makefile Outdated
$(GO) test -race -run "[^FLAKY]$$" -coverprofile=cover.out ./pkg/storer/internal/reserve/
else
$(GO) test -race -run "[^FLAKY]$$" ./...
$(GO) test -race -run "[^FLAKY]$$" ./pkg/storer/internal/reserve/
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 targets are temporarily restricted to only run ./pkg/storer/internal/reserve/ tests instead of the full test suite (./...). This appears to be a temporary debugging/development change that should not be committed. These targets should test the entire codebase in CI.

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.

Some of the actual test code has been reshuffled/changed. In general, even if it is understood, it is better to have as a separate change. The diff here is bigger than expected. If we're just adding synctest is there any reason why the diff should be more than just the synctest.Test wrapper?

@akrem-chabchoub
Copy link
Contributor Author

Some of the actual test code has been reshuffled/changed. In general, even if it is understood, it is better to have as a separate change. The diff here is bigger than expected. If we're just adding synctest is there any reason why the diff should be more than just the synctest.Test wrapper?

If you're using VSCode, these extensions can help avoid noisy diffs and make reviews much clearer:

GitHub Pull Requests:
https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github

SemanticDiff:
https://marketplace.visualstudio.com/items?itemName=semanticdiff.semanticdiff

image

@acud
Copy link
Contributor

acud commented Nov 25, 2025

Thanks @akrem-chabchoub. I don't use VSCode :) Hopefully the github diff viewer recovers from its sicknesses soon.

@akrem-chabchoub akrem-chabchoub merged commit 11f8c81 into master Nov 29, 2025
19 of 22 checks passed
@akrem-chabchoub akrem-chabchoub deleted the migrate-to-synctest-storer-reserve branch November 29, 2025 15:21
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

4 participants