diff --git a/internal/watchdog/watchdog_test.go b/internal/watchdog/watchdog_test.go index eb43975..019ddb5 100644 --- a/internal/watchdog/watchdog_test.go +++ b/internal/watchdog/watchdog_test.go @@ -111,15 +111,8 @@ func TestRun_VerifieLesTroisTypesDeRessource(t *testing.T) { w := New(db, testCfg(t), n, l, 10*time.Millisecond) ctx, cancel := context.WithCancel(context.Background()) - done := make(chan struct{}) - go func() { - w.Run(ctx) - close(done) - }() - defer func() { - cancel() - <-done - }() + defer cancel() + go w.Run(ctx) kinds := map[string]bool{} deadline := time.After(5 * time.Second)