Skip to content

Commit

Permalink
release-23.1: rpc: deflake TestHeartbeatDialback
Browse files Browse the repository at this point in the history
`require.ErrorAs` mutates. We don't want that here.

Closes #105134.

Epic: none
Release note: None
  • Loading branch information
tbg committed Jun 27, 2023
1 parent d30bce5 commit 2b2ae9a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/rpc/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2739,8 +2739,14 @@ func TestHeartbeatDialback(t *testing.T) {
case ping := <-pingChan2:
log.Infof(ctx, "Received %+v", ping)
case <-time.After(1 * time.Second):
require.ErrorAs(t, ctx1.ConnHealth(remoteAddr2, 2, DefaultClass), &ErrNoConnection)
require.ErrorAs(t, ctx2.ConnHealth(remoteAddr1, 1, SystemClass), &ErrNoConnection)
{
err1 := ctx1.ConnHealth(remoteAddr2, 2, DefaultClass)
require.True(t, errors.HasType(err1, ErrNoConnection), "%+v", err1)
}
{
err2 := ctx2.ConnHealth(remoteAddr1, 1, SystemClass)
require.True(t, errors.HasType(err2, ErrNoConnection), "%+v", err2)
}
return
}
}
Expand Down

0 comments on commit 2b2ae9a

Please sign in to comment.