Close websocket connection upon join failure (#458)

* Close websocket connection on join failure to avoid hang

* fix auto creation bug
This commit is contained in:
David Zhao
2022-02-22 17:43:25 -08:00
committed by GitHub
parent 3e7fae96ea
commit 7eb2fecadd
4 changed files with 9 additions and 1 deletions
+5
View File
@@ -361,6 +361,11 @@ func TestAutoCreate(t *testing.T) {
token := joinToken(testRoom, "start-before-create")
_, err := testclient.NewWebSocketConn(fmt.Sprintf("ws://localhost:%d", defaultServerPort), token, nil)
require.Error(t, err)
// second join should also fail
token = joinToken(testRoom, "start-before-create-2")
_, err = testclient.NewWebSocketConn(fmt.Sprintf("ws://localhost:%d", defaultServerPort), token, nil)
require.Error(t, err)
})
t.Run("join with explicit createRoom", func(t *testing.T) {