MCPcopy
hub / github.com/gorilla/websocket / TestConcurrentWritePanic

Function TestConcurrentWritePanic

conn_test.go:666–685  ·  conn_test.go::TestConcurrentWritePanic
(t *testing.T)

Source from the content-addressed store, hash-verified

664}
665
666func TestConcurrentWritePanic(t *testing.T) {
667 w := blockingWriter{make(chan struct{}), make(chan struct{})}
668 c := newTestConn(nil, w, false)
669 go func() {
670 c.WriteMessage(TextMessage, []byte{})
671 }()
672
673 // wait for goroutine to block in write.
674 <-w.c1
675
676 defer func() {
677 close(w.c2)
678 if v := recover(); v != nil {
679 return
680 }
681 }()
682
683 c.WriteMessage(TextMessage, []byte{})
684 t.Fatal("should not get here")
685}
686
687type failingReader struct{}
688

Callers

nothing calls this directly

Calls 2

newTestConnFunction · 0.85
WriteMessageMethod · 0.80

Tested by

no test coverage detected