diff --git a/pkg/runtest/run.go b/pkg/runtest/run.go index 50af943e0810..110ec15d4279 100644 --- a/pkg/runtest/run.go +++ b/pkg/runtest/run.go @@ -67,7 +67,7 @@ func (ctx *Context) log(msg string, args ...interface{}) { ctx.LogFunc(fmt.Sprintf(msg, args...)) } -func (ctx *Context) Run() error { +func (ctx *Context) Run(waitCtx context.Context) error { ctx.buildSem = make(chan bool, runtime.GOMAXPROCS(0)) ctx.executor = queue.DynamicOrder() ctx.generatePrograms() @@ -84,7 +84,7 @@ func (ctx *Context) Run() error { result = fmt.Sprintf("SKIP (%v)", req.skip) verbose = true } else { - req.Request.Wait(context.Background()) + req.Request.Wait(waitCtx) if req.err != nil { fail++ result = fmt.Sprintf("FAIL: %v", diff --git a/pkg/runtest/run_test.go b/pkg/runtest/run_test.go index 19619ee734a2..acf59c93dab5 100644 --- a/pkg/runtest/run_test.go +++ b/pkg/runtest/run_test.go @@ -85,7 +85,7 @@ func test(t *testing.T, sysTarget *targets.Target) { Verbose: true, Debug: *flagDebug, } - startRPCServer(t, target, executor, "", ctx, nil, nil, func(features flatrpc.Feature) { + waitCtx := startRPCServer(t, target, executor, "", ctx, nil, nil, func(features flatrpc.Feature) { // Features we expect to be enabled on the test OS. // All sandboxes except for none are not implemented, coverage is not returned, // and setup for few features is failing specifically to test feature detection. @@ -113,7 +113,7 @@ func test(t *testing.T, sysTarget *targets.Target) { if t.Failed() { return } - if err := ctx.Run(); err != nil { + if err := ctx.Run(waitCtx); err != nil { t.Fatal(err) } } diff --git a/syz-manager/manager.go b/syz-manager/manager.go index 9990aacc0fb6..a949089efd8c 100644 --- a/syz-manager/manager.go +++ b/syz-manager/manager.go @@ -1566,7 +1566,7 @@ func (mgr *Manager) MachineChecked(features flatrpc.Feature, enabledSyscalls map Debug: *flagDebug, } go func() { - err := ctx.Run() + err := ctx.Run(context.Background()) if err != nil { log.Fatal(err) }