mirror of
https://github.com/zrepl/zrepl.git
synced 2025-02-13 09:00:36 +01:00
transport/ssh: update go-netssh to new version => supports CloseWrite and Deadlines => build: require Go 1.11 (netssh requires it)
27 lines
491 B
Go
27 lines
491 B
Go
package heartbeatconn
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/zrepl/zrepl/rpc/dataconn/frameconn"
|
|
)
|
|
|
|
func TestFrameTypes(t *testing.T) {
|
|
assert.True(t, frameconn.IsPublicFrameType(heartbeat))
|
|
}
|
|
|
|
func TestNegativeTimer(t *testing.T) {
|
|
|
|
timer := time.NewTimer(-1 * time.Second)
|
|
defer timer.Stop()
|
|
time.Sleep(100 * time.Millisecond)
|
|
select {
|
|
case <-timer.C:
|
|
t.Log("timer with negative time fired, that's what we want")
|
|
default:
|
|
t.Fail()
|
|
}
|
|
}
|