diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-07-24 17:44:20 +0200 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2024-07-24 15:55:05 +0000 |
| commit | d1a1b0ca5ffc870174435e1a6878be98ee02dcd7 (patch) | |
| tree | ec10501ca3eb3e99c86c0f02062cdb735a021cbf /pkg/runtest/run_test.go | |
| parent | 9726361840e010a0c8acaec8c85c9a1c38c7174a (diff) | |
pkg/runtest: fix a race during startup
Run method usually runs in a separate goroutine concurrently with request consumer
(Next calls), so at least executor needs to be initialized before Run.
Otherwise we can get episodic nil derefs in Next method.
Diffstat (limited to 'pkg/runtest/run_test.go')
| -rw-r--r-- | pkg/runtest/run_test.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/runtest/run_test.go b/pkg/runtest/run_test.go index 0861b7e2b..d0c3ca780 100644 --- a/pkg/runtest/run_test.go +++ b/pkg/runtest/run_test.go @@ -85,6 +85,7 @@ func test(t *testing.T, sysTarget *targets.Target) { Verbose: true, Debug: *flagDebug, } + ctx.Init() waitCtx := startRPCServer(t, target, executor, ctx, rpcParams{ manyProcs: true, machineChecked: func(features flatrpc.Feature) { |
