Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

fix: Test race when accessing RTC session #355

Merged
merged 1 commit into from
May 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: Test race when accessing session
  • Loading branch information
kylecarbs committed May 20, 2021
commit 170b2c5557bba64ad82adf4596d7429677966ff7
6 changes: 3 additions & 3 deletions wsnet/wsnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ func createDumbBroker(t *testing.T) (connectAddr string, listenAddr string) {
t.Error(err)
return
}
nc := websocket.NetConn(context.Background(), c, websocket.MessageBinary)
mut.Lock()
defer mut.Unlock()
if sess == nil {
t.Error("listen not called")
return
}
nc := websocket.NetConn(context.Background(), c, websocket.MessageBinary)
mut.Lock()
defer mut.Unlock()
oc, err := sess.Open()
if err != nil {
t.Error(err)
Expand Down