Cloak icon indicating copy to clipboard operation
Cloak copied to clipboard

Not consistent tests

Open Randomneo opened this issue 1 year ago • 0 comments

I'm not go dev. But got issue with installing it on my machine. Installation package contain go test ./.... Which fails with this message:

--- FAIL: TestParseRedirAddr (0.01s)
    --- FAIL: TestParseRedirAddr/domain_without_port (0.00s)
        state_test.go:52: expected 23.215.0.136 got 96.7.128.198
    --- FAIL: TestParseRedirAddr/domain_with_port (0.00s)
        state_test.go:72: expected 23.215.0.136 got 23.215.0.138

I found out that test relay on ip resolving of example.com which is not consistent (each ping command resolves to different ipv4) example.com ips

and by replacing example.com with github.com or my personal domain in internal/server/state_test.go solved the issue

Randomneo avatar Mar 03 '25 20:03 Randomneo