fix(golang-github-mwitkow-conntrack): enable %check by removing flaky test suite#15945
Open
dmcilvaney wants to merge 1 commit intomicrosoft:tomls/base/mainfrom
Open
Conversation
… 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/
Contributor
There was a problem hiding this comment.
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.skipconfiguration that was disabling all tests - Added a
spec-append-linesoverlay to remove flaky test files during the%prepphase - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/