We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8abed3a commit e4879abCopy full SHA for e4879ab
conn_test.go
@@ -553,3 +553,26 @@ func assertClose(tb testing.TB, c *websocket.Conn) {
553
err := c.Close(websocket.StatusNormalClosure, "")
554
assert.Success(tb, err)
555
}
556
+
557
+func TestConcurrentClosePing(t *testing.T) {
558
+ t.Parallel()
559
+ for i := 0; i < 64; i++ {
560
+ func() {
561
+ c1, c2 := wstest.Pipe(nil, nil)
562
+ defer c1.CloseNow()
563
+ defer c2.CloseNow()
564
+ c1.CloseRead(context.Background())
565
+ c2.CloseRead(context.Background())
566
+ go func() {
567
+ for range time.Tick(time.Millisecond) {
568
+ if err := c1.Ping(context.Background()); err != nil {
569
+ return
570
+ }
571
572
+ }()
573
574
+ time.Sleep(10 * time.Millisecond)
575
+ assert.Success(t, c1.Close(websocket.StatusNormalClosure, ""))
576
577
578
+}
0 commit comments