mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 04:07:47 +08:00
fix: uint testing case for signal feature of package gproc occasionally failed (#3529)
This commit is contained in:
parent
1013df1627
commit
adc94fd97a
@ -7,11 +7,12 @@
|
|||||||
package gproc
|
package gproc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gogf/gf/v2/test/gtest"
|
|
||||||
"os"
|
"os"
|
||||||
"syscall"
|
"syscall"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/gogf/gf/v2/test/gtest"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_Signal(t *testing.T) {
|
func Test_Signal(t *testing.T) {
|
||||||
@ -79,6 +80,9 @@ func Test_Signal(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
sendSignal(syscall.SIGTERM)
|
sendSignal(syscall.SIGTERM)
|
||||||
|
// wait the listen done
|
||||||
|
time.Sleep(time.Second)
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case s := <-sigRec:
|
case s := <-sigRec:
|
||||||
t.AssertEQ(s, syscall.SIGTERM)
|
t.AssertEQ(s, syscall.SIGTERM)
|
||||||
|
Loading…
Reference in New Issue
Block a user