Skip to content

Commit

Permalink
Merge 'main' into branch 'rabbitmqgh-69/reader_routine_leak'.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebakken committed Apr 19, 2022
2 parents df0a262 + 02f3715 commit 0c5ba36
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func TestRequiredServerLocale(t *testing.T) {

func TestDefaultConnectionLocale(t *testing.T) {
conn := integrationConnection(t, "client default locale")
t.Cleanup(func() { conn.Close() })

if conn.Config.Locale != defaultLocale {
t.Fatalf("Expected default connection locale to be %s, is was: %s", defaultLocale, conn.Config.Locale)
Expand Down Expand Up @@ -201,6 +202,7 @@ func TestIsClosed(t *testing.T) {
// TestChannelIsClosed will test the public method IsClosed on a channel.
func TestChannelIsClosed(t *testing.T) {
conn := integrationConnection(t, "public channel.IsClosed()")
t.Cleanup(func() { conn.Close() })
ch, _ := conn.Channel()

if ch.IsClosed() {
Expand Down
10 changes: 10 additions & 0 deletions integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import (
"testing"
"testing/quick"
"time"

"go.uber.org/goleak"
)

func TestIntegrationOpenClose(t *testing.T) {
Expand Down Expand Up @@ -1422,6 +1424,8 @@ func TestDeadlockConsumerIssue48(t *testing.T) {
func TestRepeatedChannelExceptionWithPublishAndMaxProcsIssue46(t *testing.T) {
conn := integrationConnection(t, "issue46")
if conn != nil {
t.Cleanup(func() { conn.Close() })

for i := 0; i < 100; i++ {
ch, err := conn.Channel()
if err != nil {
Expand All @@ -1444,6 +1448,8 @@ func TestRepeatedChannelExceptionWithPublishAndMaxProcsIssue46(t *testing.T) {
func TestChannelExceptionWithCloseIssue43(t *testing.T) {
conn := integrationConnection(t, "issue43")
if conn != nil {
t.Cleanup(func() { conn.Close() })

go func() {
for err := range conn.NotifyClose(make(chan *Error)) {
t.Log(err.Error())
Expand Down Expand Up @@ -1967,3 +1973,7 @@ func generateCrc32Random(size int) []byte {

return msg
}

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m)
}

0 comments on commit 0c5ba36

Please sign in to comment.