Skip to content

Commit

Permalink
[better_conn_close_error] test 2
Browse files Browse the repository at this point in the history
  • Loading branch information
menghanl committed May 25, 2021
1 parent 6bb168a commit f3e0c6b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/transport/transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,12 @@ func (s) TestGracefulClose(t *testing.T) {
go func() {
defer wg.Done()
str, err := ct.NewStream(ctx, &CallHdr{})
if err == nil {
t.Errorf("_.NewStream(_, _) = _, %v, want _, non-nil", err)
if err != nil {
select {
case <-ct.ctxDone:
default:
t.Errorf("_.NewStream(_, _) = _, %v, while transport is not closed", err)
}
return
}
ct.Write(str, nil, nil, &Options{Last: true})
Expand Down

0 comments on commit f3e0c6b

Please sign in to comment.