Skip to content

Conversation

@akrem-chabchoub
Copy link
Contributor

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

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

@akrem-chabchoub akrem-chabchoub self-assigned this Oct 31, 2025
Copilot AI review requested due to automatic review settings October 31, 2025 15:53
@akrem-chabchoub akrem-chabchoub marked this pull request as draft October 31, 2025 15:53
@akrem-chabchoub akrem-chabchoub force-pushed the migrate-to-synctest-kademlia-flaky branch from 634753a to 119231f Compare October 31, 2025 16:00
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 a flaky test by leveraging Go's testing/synctest package to provide deterministic execution for time-dependent test logic, removing the "_FLAKY" suffix from the test name.

  • Wraps TestAddressBookQuickPrune (previously TestAddressBookQuickPrune_FLAKY) with synctest.Test for deterministic time handling
  • Removes t.Parallel() call (incompatible with synctest.Test)
  • Adds testing/synctest import to support the new testing approach

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

testutil.CleanupCloser(t, kad)

time.Sleep(100 * time.Millisecond)
time.Sleep(100 * time.Millisecond)
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using synctest.Test, real time.Sleep calls should typically be avoided as they defeat the purpose of deterministic time simulation. Consider removing this sleep or verifying if it's necessary with synctest's time control mechanisms.

Suggested change
time.Sleep(100 * time.Millisecond)
synctest.Advance(t, 100 * time.Millisecond)

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no synctest.Advance in the docs 🙂

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