From 3c929e61d5c1f909654d0d029cd03667eeeb65a2 Mon Sep 17 00:00:00 2001 From: rmatsuoka <76464810+rmatsuoka@users.noreply.github.com> Date: Fri, 22 Sep 2023 12:39:38 +0900 Subject: [PATCH] wait for lanching process --- pidfile/pid_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pidfile/pid_test.go b/pidfile/pid_test.go index 9dc63a69d..76711d6ad 100644 --- a/pidfile/pid_test.go +++ b/pidfile/pid_test.go @@ -9,6 +9,7 @@ import ( "os" "os/exec" "testing" + "time" ) func TestExistsPid(t *testing.T) { @@ -29,6 +30,9 @@ func TestGetCmdName(t *testing.T) { if err != nil { t.Fatal(err) } + + // hack: wait for launching process + time.Sleep(time.Millisecond) pid := cmd.Process.Pid expected := "sleep"