Skip to content

chore(test): make proxy test robust wrt IPv4/v6 #195

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

Merged
merged 1 commit into from
May 23, 2025

Conversation

Fabian-Gruenbichler
Copy link
Contributor

this test fails if hyper.rs resolves to an IPv6 address in the test env otherwise:

running 1 test

thread 'test_socks_v5_with_locally_resolved_domain_works' panicked at tests/proxy.rs:331:9:
assertion `left == right` failed
  left: [5, 1, 0, 4]
 right: [5, 1, 0, 1]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'test_socks_v5_with_locally_resolved_domain_works' panicked at tests/proxy.rs:301:14:
tunnel: Io(Custom { kind: UnexpectedEof, error: "unexpected eof" })

thread 'test_socks_v5_with_locally_resolved_domain_works' panicked at tests/proxy.rs:338:14:
task - client: JoinError::Panic(Id(1), "tunnel: Io(Custom { kind: UnexpectedEof, error: \"unexpected eof\" })", ...)
test test_socks_v5_with_locally_resolved_domain_works ... FAILED

failures:

failures:
    test_socks_v5_with_locally_resolved_domain_works

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 6 filtered out; finished in 0.01s

the full message returned by the test proxy:

[5, 1, 0, 4, 38, 6, 71, 0, 48, 55, 0, 0, 0, 0, 0, 0, 104, 21, 12, 232, 1, 187,0, ..] where [4..] of that in hex is ['0x26', '0x6', '0x47', '0x0', '0x30', '0x37', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x68', '0x15', '0xc', '0xe8', '0x1', '0xbb'] which corresponds to

$ host hyper.rs
...
hyper.rs has IPv6 address 2606:4700:3037::6815:ce8
...

this test fails if hyper.rs resolves to an IPv6 address in the test env
otherwise..

Signed-off-by: Fabian Grünbichler <[email protected]>
Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

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

Thanks!

@seanmonstar seanmonstar merged commit 1bcd489 into hyperium:master May 23, 2025
16 checks passed
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