In test script let master process finish his work and
don't try to kill him if killing can be avoided. If
kill invoked than do not dequeue from empty rings. Also it
looks like there is some race exist on defining which
app will be master and which will be slave if they run
at the same time. After long run following script I
do not see fails anymore:
while true; do ./test/linux-generic/pktio_ipc/pktio_ipc_run.sh || exit 1; done
https://bugs.linaro.org/show_bug.cgi?id=2505

Signed-off-by: Maxim Uvarov <[email protected]>
---
 test/linux-generic/pktio_ipc/pktio_ipc_run.sh | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/test/linux-generic/pktio_ipc/pktio_ipc_run.sh 
b/test/linux-generic/pktio_ipc/pktio_ipc_run.sh
index bd64baf..86b7c82 100755
--- a/test/linux-generic/pktio_ipc/pktio_ipc_run.sh
+++ b/test/linux-generic/pktio_ipc/pktio_ipc_run.sh
@@ -30,8 +30,9 @@ run()
        rm -rf /dev/shm/odp-${IPC_NS}* 2>&1 > /dev/null
 
        echo "==== run pktio_ipc1 then pktio_ipc2 ===="
-       pktio_ipc1${EXEEXT} -n ${IPC_NS} -t 30 &
+       pktio_ipc1${EXEEXT} -n ${IPC_NS} -t 20 &
        IPC_PID=$!
+       sleep 1
 
        pktio_ipc2${EXEEXT} -n ${IPC_NS} -t 10
        ret=$?
@@ -57,12 +58,16 @@ run()
        IPC_NS=`expr $IPC_NS - 1`
        echo "Using ns ${IPC_NS}"
 
-       pktio_ipc2${EXEEXT} -n ${IPC_NS} -t 10 &
+       pktio_ipc2${EXEEXT} -n ${IPC_NS} -t 20 &
        IPC_PID=$!
+       sleep 1
 
-       pktio_ipc1${EXEEXT} -n ${IPC_NS} -t 20
+       pktio_ipc1${EXEEXT} -n ${IPC_NS} -t 10
        ret=$?
-       (kill ${IPC_PID} 2>&1 > /dev/null) > /dev/null || true
+       kill ${IPC_PID} 2>&1 > /dev/null
+       if [ $? -eq 0 ]; then
+               rm -rf /dev/shm/odp-${IPC_NS}* 2>&1 > /dev/null
+       fi
 
        if [ $ret -ne 0 ]; then
                echo "!!! FAILED !!!"
-- 
2.7.1.250.gff4ea60

Reply via email to