Skip to content

Commit

Permalink
Fixup testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
emcfarlane committed Jun 3, 2024
1 parent 077f6a0 commit b252beb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions interceptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1629,14 +1629,12 @@ func TestStreamingClientContextCancellation(t *testing.T) {
require.NoError(t, stream.Send(nil))
require.NoError(t, stream.CloseRequest())
resp, err := stream.Receive()
assert.Equal(t, msg.GetData(), resp.GetData())
go cancel() // Close the stream before the response is received.
go func() {
_, err := stream.Receive() // Receive the end of the stream.
require.Error(t, err)
}()
require.NoError(t, stream.CloseResponse())
require.NoError(t, err)
assert.Equal(t, msg.GetData(), resp.GetData())
go cancel() // Cancel the stream before the response is received.
_, err = stream.Receive() // Receive the end of the stream.
assert.Error(t, err)

Check failure on line 1636 in interceptor_test.go

View workflow job for this annotation

GitHub Actions / ci (1.22.x)

require-error: for error assertions use require (testifylint)
assert.Nil(t, stream.CloseResponse())

Check failure on line 1637 in interceptor_test.go

View workflow job for this annotation

GitHub Actions / ci (1.22.x)

error-nil: use assert.NoError (testifylint)
}

func TestStreamingHandlerTracing(t *testing.T) {
Expand Down

0 comments on commit b252beb

Please sign in to comment.