mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-30 14:41:20 +00:00
do not drain the channel because there is no channel, duh
Fixes https://github.com/cosmos/cosmos-sdk/issues/1045
This commit is contained in:
parent
3445f1206e
commit
b8c076ca79
@ -545,9 +545,7 @@ FOR_LOOP:
|
|||||||
// not goroutine-safe
|
// not goroutine-safe
|
||||||
func (c *MConnection) stopPongTimer() {
|
func (c *MConnection) stopPongTimer() {
|
||||||
if c.pongTimer != nil {
|
if c.pongTimer != nil {
|
||||||
if !c.pongTimer.Stop() {
|
_ = c.pongTimer.Stop()
|
||||||
<-c.pongTimer.C
|
|
||||||
}
|
|
||||||
c.pongTimer = nil
|
c.pongTimer = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,11 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/fortytw2/leaktest"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"github.com/tendermint/go-amino"
|
|
||||||
|
amino "github.com/tendermint/go-amino"
|
||||||
"github.com/tendermint/tmlibs/log"
|
"github.com/tendermint/tmlibs/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -242,7 +244,11 @@ func TestMConnectionMultiplePings(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestMConnectionPingPongs(t *testing.T) {
|
func TestMConnectionPingPongs(t *testing.T) {
|
||||||
|
// check that we are not leaking any go-routines
|
||||||
|
defer leaktest.CheckTimeout(t, 10*time.Second)()
|
||||||
|
|
||||||
server, client := net.Pipe()
|
server, client := net.Pipe()
|
||||||
|
|
||||||
defer server.Close()
|
defer server.Close()
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user