Skip to content

Commit

Permalink
Refactored conn readlimit test when set by server
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Feb 1, 2024
1 parent 66a341b commit 6b6b43a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ably/realtime_channel_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,17 +302,17 @@ func TestRealtimeChannel_SetDefaultReadLimitIfServerHasNoLimit(t *testing.T) {
wrappedDialWebsocket, interceptMsg := DialIntercept(dial)

connMsgContext, cancel := context.WithCancel(context.Background())
connMessageCh := interceptMsg(connMsgContext, ably.ActionConnected)
msgCh := interceptMsg(connMsgContext, ably.ActionConnected)

app, client := ablytest.NewRealtime(ably.WithDial(wrappedDialWebsocket))
defer safeclose(t, ablytest.FullRealtimeCloser(client), app)
connWaiter := ablytest.ConnWaiter(client, nil, ably.ConnectionEventConnected)
connectedWaiter := ablytest.ConnWaiter(client, nil, ably.ConnectionEventConnected)

msg := <-connMessageCh
msg.ConnectionDetails.MaxMessageSize = 0 // 0 represents limitless message size
cancel()
connectedMsg := <-msgCh
connectedMsg.ConnectionDetails.MaxMessageSize = 0 // 0 represents limitless message size
cancel() // unblocks updated message to be processed

err := ablytest.Wait(connWaiter, nil)
err := ablytest.Wait(connectedWaiter, nil)
assert.Nil(t, err)

// If server set limit is 0, value is set to default readlimit
Expand Down

0 comments on commit 6b6b43a

Please sign in to comment.