- Notifications
You must be signed in to change notification settings - Fork 335
Closed
Milestone
Description
If Close is called after the HTTP server has been closed, a goroutine currently leaks.
package main import ( "context""net/http""net/http/httptest""go.uber.org/goleak""nhooyr.io/websocket" ) funcmain(){done:=make(chanstruct{}) srv:=httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r*http.Request){conn, err:=websocket.Accept(rw, r, nil) iferr!=nil{panic(err) } close(done) conn.Close(websocket.StatusNormalClosure, "") })) _, _, err:=websocket.Dial(context.Background(), srv.URL, nil) iferr!=nil{panic(err) } <-donesrv.Close() err=goleak.Find() iferr!=nil{panic(err) } }Metadata
Metadata
Assignees
Labels
No labels