From 351635d9b52d4641cebb706c31d1086fbd8e6b3b Mon Sep 17 00:00:00 2001 From: GnomeZworc Date: Sat, 24 Oct 2026 14:18:55 +0200 Subject: [PATCH] f-83: watchdog: le test attend la fin de Run avant la fermeture de la base #83 Signed-off-by: GnomeZworc --- internal/watchdog/watchdog_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/watchdog/watchdog_test.go b/internal/watchdog/watchdog_test.go index 019ddb5..eb43975 100644 --- a/internal/watchdog/watchdog_test.go +++ b/internal/watchdog/watchdog_test.go @@ -111,8 +111,15 @@ func TestRun_VerifieLesTroisTypesDeRessource(t *testing.T) { w := New(db, testCfg(t), n, l, 10*time.Millisecond) ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - go w.Run(ctx) + done := make(chan struct{}) + go func() { + w.Run(ctx) + close(done) + }() + defer func() { + cancel() + <-done + }() kinds := map[string]bool{} deadline := time.After(5 * time.Second)