Skip to content

Use synctest for TestNewTracker in pkg/agent/nodeip#7822

Open
antoninbas wants to merge 1 commit intomainfrom
use-synctest-for-TestNewTracker
Open

Use synctest for TestNewTracker in pkg/agent/nodeip#7822
antoninbas wants to merge 1 commit intomainfrom
use-synctest-for-TestNewTracker

Conversation

@antoninbas
Copy link
Contributor

Instead of relying on polling (with assert.Eventually). The motivation for this change is that we observed a test failure in CI.

Instead of relying on polling (with `assert.Eventually`).
The motivation for this change is that we observed a test failure in CI.

Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
Copilot AI review requested due to automatic review settings March 4, 2026 22: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 replaces polling-based test synchronization (assert.EventuallyWithT with a 2-second timeout and 10ms polling interval) with the deterministic testing/synctest package in TestNewTracker. This resolves a flaky CI failure caused by timing sensitivity in the original approach.

Changes:

  • Wrap TestNewTracker body in synctest.Test to create a controlled goroutine bubble.
  • Replace assert.EventuallyWithT calls with synctest.Wait() for deterministic synchronization after Create/Update/Delete operations.
  • Add proper error checking (require.NoError) for Kubernetes API calls that were previously unchecked.

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

@antoninbas antoninbas requested review from luolanzone and tnqn March 4, 2026 23:17
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