Skip to content

Comments

fix(golang-github-mwitkow-conntrack): enable %check by removing flaky test suite#15945

Open
dmcilvaney wants to merge 1 commit intomicrosoft:tomls/base/mainfrom
dmcilvaney:damcilva/4.0/pkg_fixes/go-conntrack
Open

fix(golang-github-mwitkow-conntrack): enable %check by removing flaky test suite#15945
dmcilvaney wants to merge 1 commit intomicrosoft:tomls/base/mainfrom
dmcilvaney:damcilva/4.0/pkg_fixes/go-conntrack

Conversation

@dmcilvaney
Copy link
Contributor

The upstream codebase is abandoned (mwitkow/go-conntrack#14). listener_test.go has a race condition in TestMonitoringNormalConns: the test calls conn.Close() and immediately checks the connection counter, but the counter is incremented asynchronously when the server processes the close. Missing a sleep between close and assertion causes intermittent failures:

listener_test.go:81:
Error: Not equal:
expected: 2
actual : 1
Messages: the closed conn counter must be incremented after connection was closed

dialer_test.go extends ListenerTestSuite so must also be removed.

Rather than skipping %check entirely, remove only the flaky suite files so promhelper_test.go and tracehelper_test.go can still run.

Tested: Built successfully with %check passing, package installs correctly with Go source files present in /usr/share/gocode/src/github.com/mwitkow/go-conntrack/

… test suite

The upstream codebase is abandoned (mwitkow/go-conntrack#14).
listener_test.go has a race condition in TestMonitoringNormalConns: the test
calls conn.Close() and immediately checks the connection counter, but the counter
is incremented asynchronously when the server processes the close. Missing a
sleep between close and assertion causes intermittent failures:

  listener_test.go:81:
    Error:      Not equal:
                expected: 2
                actual  : 1
    Messages:   the closed conn counter must be incremented after connection was closed

dialer_test.go extends ListenerTestSuite so must also be removed.

Rather than skipping %check entirely, remove only the flaky suite files so
promhelper_test.go and tracehelper_test.go can still run.

Tested: Built successfully with %check passing, package installs correctly
with Go source files present in /usr/share/gocode/src/github.com/mwitkow/go-conntrack/
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 improves test handling for golang-github-mwitkow-conntrack by removing specific flaky test files rather than disabling all tests. The upstream project is abandoned and contains a race condition in listener_test.go that causes intermittent test failures. Instead of skipping the entire %check section, this change surgically removes only the problematic test files (listener_test.go and dialer_test.go) while allowing the stable tests (promhelper_test.go and tracehelper_test.go) to continue running.

Changes:

  • Removed the check.skip configuration that was disabling all tests
  • Added a spec-append-lines overlay to remove flaky test files during the %prep phase
  • Added comprehensive documentation explaining the race condition and why specific files are removed

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

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.

1 participant