Fix 055.backend_all_down test failure.
authorTatsuo Ishii <[email protected]>
Tue, 12 Jun 2018 06:21:52 +0000 (15:21 +0900)
committerTatsuo Ishii <[email protected]>
Tue, 12 Jun 2018 06:35:43 +0000 (15:35 +0900)
The test fails because pgpool zombie child process remains. Actually
the failover process is properly performed but when the shutdown
script is executed in background, output to stdout/stderr was blocked,
and this could cause the zombie process syndrome. Soltution is,
redirecting stdout/stderr to /dev/null when sponing the shutdown
script in background.

test/regression/tests/055.backend_all_down/test.sh

index f9497a886eaaeaf3c673fe0812085676ef09618d..8e4836b3025291a134e3a4e932aaf5a49b96476f 100755 (executable)
@@ -33,15 +33,23 @@ while true
 do
        grep "failover done. shutdown host $PGSOCKET_DIR(11001)" log/pgpool.log > /dev/null 2>&1
        if [ $? = 0 ];then
+               echo "shutdown detected"
                break;
        fi
+
+       grep "failover: no backends are degenerated" log/pgpool.log > /dev/null 2>&1
+       if [ $? = 0 ];then
+               echo "no backend to degenerate detected"
+               break;
+       fi
+
        sleep 1
 done
 
 # if that's the case, shutdownall will hang.
-(./shutdownall)&
+(./shutdownall) >/dev/null 2>&1 &
 sleep 5
-kill $!
+kill $pid
 
 if [ $? = 0 ];then
        ./shutdownall