Skip to content
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

TestPing failed on Windows #101

Closed
jinmiaoluo opened this issue Jun 2, 2022 · 1 comment
Closed

TestPing failed on Windows #101

jinmiaoluo opened this issue Jun 2, 2022 · 1 comment

Comments

@jinmiaoluo
Copy link

run TestPing on Linux

$ go test . -run '^TestPing$' -v 
=== RUN   TestPing
--- PASS: TestPing (0.00s)
PASS
ok      github.com/hashicorp/yamux      0.002s

run TestPing on Windows

PS C:\Users\jinmiaoluo\repo\yamux> go test . -run '^TestPing$' -v 
=== RUN   TestPing
    session_test.go:98: bad: 0s
--- FAIL: TestPing (0.00s)
FAIL
FAIL    github.com/hashicorp/yamux      0.178s
FAIL
PS C:\Users\jinmiaoluo\repo\yamux>

debug on Linux

$ dlv test .
Type 'help' for list of commands.
(dlv) b ./session_test.go:94
Breakpoint 1 set at 0x56eb44 for github.com/hashicorp/yamux.TestPing() ./session_test.go:94
(dlv) c
> github.com/hashicorp/yamux.TestPing() ./session_test.go:94 (hits goroutine(8):1 total:1) (PC: 0x56eb44)
    89:         client, server := testClientServer()
    90:         defer client.Close()
    91:         defer server.Close()
    92: 
    93:         rtt, err := client.Ping()
=>  94:         if err != nil {
    95:                 t.Fatalf("err: %v", err)
    96:         }
    97:         if rtt == 0 {
    98:                 t.Fatalf("bad: %v", rtt)
    99:         }
(dlv) p rtt
196033
(dlv) 

debug on Windows

(dlv) b c:/users/jinmiaoluo/repo/yamux/session_test.go:94
Breakpoint 1 set at 0x5b8544 for github.com/hashicorp/yamux.TestPing() c:/users/jinmiaoluo/repo/yamux/session_test.go:94
(dlv) c
> github.com/hashicorp/yamux.TestPing() c:/users/jinmiaoluo/repo/yamux/session_test.go:94 (hits goroutine(8):1 total:1) (PC: 0x5b8544)
    89:         client, server := testClientServer()
    90:         defer client.Close()
    91:         defer server.Close()
    92:
    93:         rtt, err := client.Ping()
=>  94:         if err != nil {
    95:                 t.Fatalf("err: %v", err)
    96:         }
    97:         if rtt == 0 {
    98:                 t.Fatalf("bad: %v", rtt)
    99:         }
(dlv) p rtt
0
(dlv)
@jinmiaoluo
Copy link
Author

Same issue: #41

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

No branches or pull requests

1 participant