@@ -329,17 +329,21 @@ func runSigProxy(t *testing.T, args ...string) (string, bool, bool) {
329
329
testutil .SigProxyTestScript ,
330
330
)
331
331
332
- process := base .Cmd (fullArgs ... ).Start ()
332
+ result := base .Cmd (fullArgs ... ).Start ()
333
+ process := result .Cmd .Process
333
334
334
- // This sleep waits for until we reach the trap command in the shell script, if sigint is send before that we dont enter the while loop .
335
+ // Waits until we reach the trap command in the shell script, then sends SIGINT .
335
336
time .Sleep (3 * time .Second )
336
- syscall .Kill (process .Cmd . Process . Pid , syscall .SIGINT )
337
+ syscall .Kill (process .Pid , syscall .SIGINT )
337
338
338
- //define wait delay to avoid timeout
339
- process .Cmd .WaitDelay = 3 * time .Second
340
- process .Cmd .Wait ()
339
+ // Waits until SIGINT is sent and responded to, then kills process to avoid timeout
340
+ time .Sleep (3 * time .Second )
341
+ process .Kill ()
342
+
343
+ sigIntRecieved := strings .Contains (result .Stdout (), testutil .SigProxyTrueOut )
344
+ timedOut := strings .Contains (result .Stdout (), testutil .SigProxyTimeoutMsg )
341
345
342
- return process .Stdout (), strings . Contains ( process . Stdout (), testutil . SigProxyTrueOut ), strings . Contains ( process . Stdout (), testutil . SigProxyTimeoutMsg )
346
+ return result .Stdout (), sigIntRecieved , timedOut
343
347
}
344
348
345
349
func TestRunSigProxy (t * testing.T ) {
0 commit comments