f-83: watchdog: le test attend la fin de Run avant la fermeture de la base #83

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-10-24 14:18:55 +02:00
commit 351635d9b5
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632

View file

@ -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)