@@ -73,7 +73,7 @@ func TestRunSimple(t *testing.T) {
73
73
{
74
74
name : "timed out" ,
75
75
cmd : exec .Command (shellcmd , shellflag , fmt .Sprintf ("%s -sleep 3" , stubCmd )),
76
- duration : 1 * time .Second ,
76
+ duration : 100 * time .Millisecond ,
77
77
signal : os .Interrupt ,
78
78
expectedExit : 124 ,
79
79
},
@@ -82,29 +82,29 @@ func TestRunSimple(t *testing.T) {
82
82
cmd : exec .Command (shellcmd , shellflag , fmt .Sprintf ("%s -sleep 3" , stubCmd )),
83
83
duration : time .Duration (0.1 * float64 (time .Second )),
84
84
preserveStatus : true ,
85
- expectedExit : 128 + 15 ,
85
+ expectedExit : 128 + int ( syscall . SIGTERM ) ,
86
86
skipOnWin : true ,
87
87
},
88
88
{
89
89
name : "preserve status (signal trapd)" ,
90
90
cmd : exec .Command (stubCmd , "-trap" , "SIGTERM" , "-trap-exit" , "23" , "-sleep" , "3" ),
91
- duration : 1 * time .Second ,
91
+ duration : 100 * time .Millisecond ,
92
92
preserveStatus : true ,
93
93
expectedExit : 23 ,
94
94
skipOnWin : true ,
95
95
},
96
96
{
97
97
name : "kill after" ,
98
98
cmd : exec .Command (stubCmd , "-trap" , "SIGTERM" , "-sleep" , "3" ),
99
- duration : 1 * time .Second ,
100
- killAfter : 1 * time .Second ,
99
+ duration : 100 * time .Millisecond ,
100
+ killAfter : 100 * time .Microsecond ,
101
101
signal : syscall .SIGTERM ,
102
102
expectedExit : exitKilled ,
103
103
},
104
104
{
105
105
name : "trap sigterm but exited before kill after" ,
106
- cmd : exec .Command (stubCmd , "-trap" , "SIGTERM" , "-sleep" , "3 " ),
107
- duration : 1 * time .Second ,
106
+ cmd : exec .Command (stubCmd , "-trap" , "SIGTERM" , "-sleep" , "0.8 " ),
107
+ duration : 100 * time .Millisecond ,
108
108
killAfter : 5 * time .Second ,
109
109
signal : syscall .SIGTERM ,
110
110
preserveStatus : true ,
0 commit comments