diff --git a/cmd/geth/attach_test.go b/cmd/geth/attach_test.go index 1df25359c5..a2b575022e 100644 --- a/cmd/geth/attach_test.go +++ b/cmd/geth/attach_test.go @@ -42,10 +42,13 @@ func TestAttachWithHeaders(t *testing.T) { } port := ln.Addr().(*net.TCPAddr).Port testReceiveHeaders(t, ln, "attach", "-H", "first: one", "-H", "second: two", fmt.Sprintf("http://localhost:%d", port)) - // This way to do it fails due to flag ordering: - // - // testReceiveHeaders(t, ln, "-H", "first: one", "-H", "second: two", "attach", fmt.Sprintf("http://localhost:%d", port)) - // This is fixed in a follow-up PR. + + ln, err = net.Listen("tcp", "localhost:0") + if err != nil { + t.Fatal(err) + } + port = ln.Addr().(*net.TCPAddr).Port + testReceiveHeaders(t, ln, "-H", "first: one", "-H", "second: two", "attach", fmt.Sprintf("http://localhost:%d", port)) } // TestRemoteDbWithHeaders tests that 'geth db --remotedb' with custom headers works, i.e