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

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 added this to the v2.7.0 milestone Oct 29, 2025
@akrem-chabchoub akrem-chabchoub marked this pull request as ready for review October 29, 2025 15:39
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 modernizes test timing control by adopting Go's testing/synctest package for time-sensitive tests in the reacher component. The main goal is to replace traditional time-based testing with deterministic, controllable time manipulation.

  • Replaced t.Parallel() with synctest.Test() in two test functions
  • Added testing/synctest import
  • Modified Makefile to scope CI test runs to the reacher package

Reviewed Changes

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

File Description
pkg/p2p/libp2p/internal/reacher/reacher_test.go Wrapped test bodies with synctest.Test() and removed t.Parallel() calls to enable deterministic time control in timing-sensitive tests
Makefile Narrowed test-ci and test-ci-race targets to run only the reacher package tests instead of all tests

💡 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/p2p/libp2p/internal/reacher
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 has been narrowed to run only the reacher package tests. This breaks the CI testing for the rest of the codebase. If this is intended for testing purposes only, it should not be committed. Otherwise, revert to ./... to ensure comprehensive test coverage in CI.

Copilot uses AI. Check for mistakes.
$(GO) test -run "[^FLAKY]$$" -coverprofile=cover.out ./pkg/p2p/libp2p/internal/reacher
else
$(GO) test -run "[^FLAKY]$$" ./...
$(GO) test -run "[^FLAKY]$$" ./pkg/p2p/libp2p/internal/reacher
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 has been narrowed to run only the reacher package tests. This breaks the CI testing for the rest of the codebase. If this is intended for testing purposes only, it should not be committed. Otherwise, revert to ./... to ensure comprehensive test coverage in CI.

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/p2p/libp2p/internal/reacher
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 narrowed to run only the reacher package tests. This breaks the CI race detection testing for the rest of the codebase. If this is intended for testing purposes only, it should not be committed. Otherwise, revert to ./... to ensure comprehensive test coverage in CI.

Copilot uses AI. Check for mistakes.
$(GO) test -race -run "[^FLAKY]$$" -coverprofile=cover.out ./pkg/p2p/libp2p/internal/reacher
else
$(GO) test -race -run "[^FLAKY]$$" ./...
$(GO) test -race -run "[^FLAKY]$$" ./pkg/p2p/libp2p/internal/reacher
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 narrowed to run only the reacher package tests. This breaks the CI race detection testing for the rest of the codebase. If this is intended for testing purposes only, it should not be committed. Otherwise, revert to ./... to ensure comprehensive test coverage in CI.

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

2 participants