From d03b0c97faf4610981228dd69f6f9a94ab9f693b Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 28 Jan 2025 11:13:19 +0100 Subject: pkg/manager: abort timers on context closure There's a 15 minutes timer in the diff fuzzer that needs to be conditional on the context object. --- pkg/manager/diff.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/manager/diff.go b/pkg/manager/diff.go index 8218ce924..bdf638a51 100644 --- a/pkg/manager/diff.go +++ b/pkg/manager/diff.go @@ -110,7 +110,11 @@ func (dc *diffContext) Loop(baseCtx context.Context) error { // Let both base and patched instances somewhat progress in fuzzing before we take // VMs away for bug reproduction. // TODO: determine the exact moment of corpus triage. - time.Sleep(15 * time.Minute) + select { + case <-time.After(15 * time.Minute): + case <-ctx.Done(): + return nil + } log.Logf(0, "starting bug reproductions") reproLoop.Loop(ctx) return nil -- cgit mrf-deployment