Commit a7d4a719 authored by Steven Allen's avatar Steven Allen

tests: remove ticker leak

parent 5f17f834
...@@ -35,7 +35,8 @@ func (tp *provider) TestBasicPubSub(t *testing.T) { ...@@ -35,7 +35,8 @@ func (tp *provider) TestBasicPubSub(t *testing.T) {
} }
go func() { go func() {
tick := time.Tick(100 * time.Millisecond) ticker := time.NewTicker(100 * time.Millisecond)
defer ticker.Stop()
for { for {
err := apis[1].PubSub().Publish(ctx, "testch", []byte("hello world")) err := apis[1].PubSub().Publish(ctx, "testch", []byte("hello world"))
...@@ -45,7 +46,7 @@ func (tp *provider) TestBasicPubSub(t *testing.T) { ...@@ -45,7 +46,7 @@ func (tp *provider) TestBasicPubSub(t *testing.T) {
return return
} }
select { select {
case <-tick: case <-ticker.C:
case <-ctx.Done(): case <-ctx.Done():
return return
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment