diff --git a/transport/internet/tcp/sockopt_linux_test.go b/transport/internet/tcp/sockopt_linux_test.go index a92b746bb..34e430d8d 100644 --- a/transport/internet/tcp/sockopt_linux_test.go +++ b/transport/internet/tcp/sockopt_linux_test.go @@ -4,6 +4,7 @@ package tcp_test import ( "context" + "strings" "testing" "v2ray.com/core/testing/assert" @@ -23,6 +24,6 @@ func TestGetOriginalDestination(t *testing.T) { assert.Error(err).IsNil() defer conn.Close() - _, err = GetOriginalDestination(conn) - assert.String(err.Error()).Contains("failed to call getsockopt") + originalDest, err := GetOriginalDestination(conn) + assert.Bool(dest == originalDest || strings.Contains(err.Error(), "failed to call getsockopt")) }