mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
tests: add an helper to start/stop components
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"gopkg.in/tomb.v2"
|
||||
|
||||
"akvorado/common/helpers"
|
||||
"akvorado/common/reporter"
|
||||
)
|
||||
|
||||
@@ -16,7 +17,7 @@ func TestTerminate(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("New() error:\n%+v", err)
|
||||
}
|
||||
c.Start()
|
||||
helpers.StartStop(t, c)
|
||||
|
||||
select {
|
||||
case <-c.Terminated():
|
||||
@@ -75,7 +76,7 @@ func TestTombTracking(t *testing.T) {
|
||||
}
|
||||
|
||||
c.Track(&tomb, "tomb")
|
||||
c.Start()
|
||||
helpers.StartStop(t, c)
|
||||
|
||||
ch := make(chan bool)
|
||||
tomb.Go(func() error {
|
||||
|
||||
Reference in New Issue
Block a user