mirror of
https://github.com/tendermint/tendermint.git
synced 2026-05-31 19:36:20 +00:00
fix recursion
This commit is contained in:
@@ -36,7 +36,8 @@ func (t *defaultTicker) Chan() <-chan time.Time {
|
||||
|
||||
// Implements Ticker
|
||||
func (t *defaultTicker) Stop() {
|
||||
t.Stop()
|
||||
tt := time.Ticker(*t)
|
||||
tt.Stop()
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
|
||||
@@ -7,8 +7,12 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
// NOTE: this only tests with the LogicalTicker.
|
||||
// How do you test a real-clock ticker properly?
|
||||
func TestDefaultTicker(t *testing.T) {
|
||||
ticker := defaultTickerMaker(time.Millisecond * 10)
|
||||
<-ticker.Chan()
|
||||
ticker.Stop()
|
||||
}
|
||||
|
||||
func TestRepeat(t *testing.T) {
|
||||
|
||||
ch := make(chan time.Time, 100)
|
||||
|
||||
Reference in New Issue
Block a user