(t *testing.T)
| 594 | } |
| 595 | |
| 596 | func TestWSNoDeadlockOnAuthFailure(t *testing.T) { |
| 597 | o := testWSGetDefaultOptions(t, false) |
| 598 | o.Username = "user" |
| 599 | o.Password = "pwd" |
| 600 | s := RunServerWithOptions(o) |
| 601 | defer s.Shutdown() |
| 602 | |
| 603 | tm := time.AfterFunc(3*time.Second, func() { |
| 604 | buf := make([]byte, 1000000) |
| 605 | n := runtime.Stack(buf, true) |
| 606 | panic(fmt.Sprintf("Test has probably deadlocked!\n%s\n", buf[:n])) |
| 607 | }) |
| 608 | |
| 609 | if _, err := nats.Connect(fmt.Sprintf("ws://127.0.0.1:%d", o.Websocket.Port)); err == nil { |
| 610 | t.Fatal("Expected auth error, did not get any error") |
| 611 | } |
| 612 | |
| 613 | tm.Stop() |
| 614 | } |
| 615 | |
| 616 | func TestWsWithCustomHeaders(t *testing.T) { |
| 617 | sopts := testWSGetDefaultOptions(t, false) |
nothing calls this directly
no test coverage detected