Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing tests on systems not supporting IPv6 #1725

Merged
merged 1 commit into from
Dec 18, 2020

Conversation

lammel
Copy link
Contributor

@lammel lammel commented Dec 17, 2020

A very naive fix to allow running tests on non-IPv6 enabled systems.

Although Go implements supportsIPv6 and supportsIPv4 in the net package for it's own tests those functions are private and cannot be used outside.

This will fix CI tests which run on non-IPv6 enabled systems (and those on my laptop).

@lammel lammel requested a review from pafuent December 17, 2020 22:22
@lammel
Copy link
Contributor Author

lammel commented Dec 17, 2020

Build failure persists after revert merge in PR #1722.

image

The acutall cause seems to be IPv6 testing due to added tests in PR #1667 .

--- FAIL: TestEchoListenerNetwork (0.81s)
    --- FAIL: TestEchoListenerNetwork/tcp_ipv6_address (0.20s)
        echo_test.go:763: 
            	Error Trace:	echo_test.go:763
            	Error:      	Get "http://[::1]:1323/ok": dial tcp [::1]:1323: connect: cannot assign requested address
            	Test:       	TestEchoListenerNetwork/tcp_ipv6_address
    --- FAIL: TestEchoListenerNetwork/tcp6_ipv6_address (0.20s)
        echo_test.go:763: 
            	Error Trace:	echo_test.go:763
            	Error:      	Get "http://[::1]:1323/ok": dial tcp [::1]:1323: connect: cannot assign requested address
            	Test:       	TestEchoListenerNetwork/tcp6_ipv6_address

@lammel
Copy link
Contributor Author

lammel commented Dec 17, 2020

@pafuent Please review and merge

echo_test.go Outdated
func TestEchoListenerNetwork(t *testing.T) {
for _, tt := range listenerNetworkTests {
if !supportsIPv6() && strings.Contains(tt.address, "::") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please store the value of supportsIPv6() in a variable before the for to avoid getting Interfaces information for every test

Copy link
Contributor

Choose a reason for hiding this comment

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

nice catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops. Fixing

@lammel lammel force-pushed the bugfix/conditional-ipv6-tests branch from 8e114d8 to 3e5a3f4 Compare December 18, 2020 13:15
@lammel lammel force-pushed the bugfix/conditional-ipv6-tests branch from 3e5a3f4 to e4fe8c8 Compare December 18, 2020 13:20
@lammel
Copy link
Contributor Author

lammel commented Dec 18, 2020

Rebased on master. Fixed open issues.

@lammel lammel self-assigned this Dec 18, 2020
@lammel lammel merged commit 936c48a into labstack:master Dec 18, 2020
@lammel
Copy link
Contributor Author

lammel commented Dec 18, 2020

Master tests are green again!

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.

3 participants