Skip to content

Commit

Permalink
Fix flaky TestSendCustomMessagePendingError (#292)
Browse files Browse the repository at this point in the history
Signed-off-by: Paschalis Tsilias <[email protected]>
  • Loading branch information
tpaschalis authored Aug 20, 2024
1 parent f3f5411 commit 182ce37
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/clientimpl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1905,8 +1905,6 @@ func TestSendCustomMessagePendingError(t *testing.T) {
}
client.SetCustomCapabilities(clientCustomCapabilities)

assert.NoError(t, client.Start(context.Background(), settings))

customMessage1 := &protobufs.CustomMessage{
Capability: "local.test.example",
Type: "hello",
Expand All @@ -1918,6 +1916,7 @@ func TestSendCustomMessagePendingError(t *testing.T) {
Data: []byte("test message 2"),
}

// Send a message to the unstarted client.
_, err := client.SendCustomMessage(customMessage1)
assert.NoError(t, err)

Expand All @@ -1926,6 +1925,9 @@ func TestSendCustomMessagePendingError(t *testing.T) {
assert.ErrorIs(t, err, types.ErrCustomMessagePending)
assert.NotNil(t, sendingChan)

// Start the client so we can start processing messages properly.
assert.NoError(t, client.Start(context.Background(), settings))

// Receive the first custom message
eventually(
t,
Expand Down

0 comments on commit 182ce37

Please sign in to comment.