[TEST] To manage gbs build time, add time limit to './testAll'
authorsewon.oh <sewon.oh@samsung.com>
Thu, 25 Oct 2018 02:01:34 +0000 (11:01 +0900)
committerGeunsik Lim <leemgs@users.noreply.github.com>
Fri, 2 Nov 2018 06:05:56 +0000 (15:05 +0900)
Set a time limit(10min) to prevent './testAll' from getting longer while gbs build.

Signed-off-by: sewon.oh <sewon.oh@samsung.com>
packaging/nnstreamer.spec

index 619bb26..5491efc 100644 (file)
@@ -40,6 +40,8 @@ BuildRequires: coregl-devel
 BuildRequires: cairo-devel
 # custom_example_opencv filter requires opencv-devel
 BuildRequires: opencv-devel
+# For './testAll.sh' time limit.
+BuildRequires: procps
 
 %if 0%{?testcoverage}
 BuildRequires: lcov
@@ -102,7 +104,23 @@ pushd build
 popd
 
 pushd tests
-./testAll.sh
+# The 'testAll.sh' script requires 6~7min to run armv7l binary files in the current CI server.
+# The timeout value is 10min as a heuristic value from our experience.
+timeout=600
+./testAll.sh &
+pid=$!
+while ((timeout > 0)); do
+    sleep 1
+    if [[ ! $(ps | grep "$pid") ]]; then
+        break;
+    fi
+    (( timeout -= 60 ))
+done
+if [[ $(ps | grep "$pid") ]]; then
+    kill $pid
+    echo "GBS is stopped because of './testAll.sh' timeout(10min)"
+    exit 124 # 124 is ubuntu status code of timeout
+fi
 popd
 
 %if 0%{?testcoverage}