fix: uint testing case for signal feature of package gproc occasionally failed (#3529)

This commit is contained in:
John Guo 2024-04-23 21:30:33 +08:00 committed by GitHub
parent 1013df1627
commit adc94fd97a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)