diff --git a/os/gproc/gproc_z_signal_test.go b/os/gproc/gproc_z_signal_test.go index d9e547830..ff5dc09a0 100644 --- a/os/gproc/gproc_z_signal_test.go +++ b/os/gproc/gproc_z_signal_test.go @@ -7,11 +7,12 @@ package gproc import ( - "github.com/gogf/gf/v2/test/gtest" "os" "syscall" "testing" "time" + + "github.com/gogf/gf/v2/test/gtest" ) func Test_Signal(t *testing.T) { @@ -79,6 +80,9 @@ func Test_Signal(t *testing.T) { }) sendSignal(syscall.SIGTERM) + // wait the listen done + time.Sleep(time.Second) + select { case s := <-sigRec: t.AssertEQ(s, syscall.SIGTERM)