From 089405dfcd3920f60aebc1f0ddd7980f91ff5d42 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 22 Dec 2018 15:01:13 +0300 Subject: Make testscript to wait longer for openssl agent terminatng --- tests/agent-pkcs11.testscript | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/agent-pkcs11.testscript b/tests/agent-pkcs11.testscript index de7ecf2..31a4d9f 100644 --- a/tests/agent-pkcs11.testscript +++ b/tests/agent-pkcs11.testscript @@ -39,10 +39,20 @@ echo Agent pid $pid EOO - kill -0 "$pid"; # Make sure the agent is running. - kill "$pid"; # Signal the agent to terminate. - sleep 2; # Wait a bit while the agent is terminating. - kill -0 "$pid" 2>! != 0 # Make sure the agent is not running. + kill -0 "$pid"; # Make sure the agent is running. + kill "$pid"; # Signal the agent to terminate. + sleep 2; # Wait a bit while the agent is terminating. + + # Make sure the agent is not running. + # + # Normally two seconds should be enough for the agent to terminate. It can + # probably take longer in some rear cases, but not being able to terminate + # in ten seconds most likely indicates an issue. + # + if kill -0 "$pid" 2>! + sleep 8 + kill -0 "$pid" 2>! != 0 + end } } -- cgit v1.1