From 381ccbf2f8752e9369efc68aacae65f769378ba3 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 8 Feb 2019 16:18:19 +0100 Subject: pkg/ipc: generate better temp name for executor Just appending the pid number can produce conflicting names if the name itself ends with digits (standard temp file naming convention). So append ".PID". Also remove beginning from too long names instead of ending. Temp files in tests has unique numbers at the end, we need to preserve them to avoid file name conflicts. --- pkg/ipc/ipc_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/ipc/ipc_test.go') diff --git a/pkg/ipc/ipc_test.go b/pkg/ipc/ipc_test.go index 8d0ca7ff5..42d066d08 100644 --- a/pkg/ipc/ipc_test.go +++ b/pkg/ipc/ipc_test.go @@ -127,8 +127,9 @@ func TestParallel(t *testing.T) { const P = 10 errs := make(chan error, P) for p := 0; p < P; p++ { + p := p go func() { - env, err := MakeEnv(cfg, 0) + env, err := MakeEnv(cfg, p) if err != nil { errs <- fmt.Errorf("failed to create env: %v", err) return -- cgit mrf-deployment