Skip to content

Fix integration tests on macOS#754

Merged
taik0 merged 1 commit into
luraproject:masterfrom
thiagosalles:fix/integration-tests-on-mac-753
Aug 19, 2025
Merged

Fix integration tests on macOS#754
taik0 merged 1 commit into
luraproject:masterfrom
thiagosalles:fix/integration-tests-on-mac-753

Conversation

@thiagosalles
Copy link
Copy Markdown
Contributor

@thiagosalles thiagosalles commented Mar 19, 2025

Fix integration tests by binding the listener to localhost, just like the client

The integration tests were failing because the server listener was configured with net.Listen("tcp", ":8080"), without specifying a hostname, which binds to all network interfaces (including IPv6). Meanwhile, the client connection used net.Dial("tcp", "localhost:8080"), which resolved to IPv4 (127.0.0.1) on my machine.

The discrepancy between the listener accepting both IPv4 and IPv6 and the client specifically using IPv4 may have caused the X-Forwarded-For header to be populated with the client’s IP (127.0.0.1) instead of being empty, as the tests expected.

Changing the listener to net.Listen("tcp", "localhost:8080") ensures the server binds to the same interface as the client, aligning with the test expectations and fixing the failures.

Evidence

After the modification, the integration tests pass successfully:

$ go test -tags integration ./test
ok  	github.com/luraproject/lura/v2/test	3.107s

Fixes #753

@kpacha
Copy link
Copy Markdown
Member

kpacha commented Apr 30, 2025

@thiagosalles can you please sign your commits with -S so the author gets verified?

@thiagosalles thiagosalles force-pushed the fix/integration-tests-on-mac-753 branch from 0abd3d1 to e8c3981 Compare April 30, 2025 18:25
@thiagosalles
Copy link
Copy Markdown
Contributor Author

thiagosalles commented Apr 30, 2025

@thiagosalles can you please sign your commits with -S so the author gets verified?

Hello, @kpacha. OK, done!

Signed-off-by: Thiago Salles <tsmlima@gmail.com>
@thiagosalles thiagosalles force-pushed the fix/integration-tests-on-mac-753 branch from e8c3981 to c54913d Compare May 6, 2025 21:52
@taik0 taik0 merged commit a098b22 into luraproject:master Aug 19, 2025
4 checks passed
taik0 added a commit that referenced this pull request Aug 19, 2025
Signed-off-by: Daniel Ortiz <dortiz@krakend.io>
@github-actions
Copy link
Copy Markdown

This pull request was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration tests failing locally on macOS

3 participants