diff --git a/.github/scripts/run_ui_tests.sh b/.github/scripts/run_ui_tests.sh index 2cd1e6f07b..17cc79bc7c 100644 --- a/.github/scripts/run_ui_tests.sh +++ b/.github/scripts/run_ui_tests.sh @@ -1,15 +1,17 @@ -#! /usr/bin/env bash +#!/bin/bash sudo apt update apt install net-tools mkdir tests +COUNT=0 #download connector ui tests while [ ! -f $HOME/target/test/connector_tests.json ] do - if [ $SECONDS > 20 ] + if [ $COUNT -gt 10 ]; then exit 1 fi + COUNT=$((COUNT+1)) sleep 2 wget $UI_TESTCASES_PATH && mv testcases $HOME/target/test/connector_tests.json done @@ -20,12 +22,15 @@ $GECKOWEBDRIVER/geckodriver > tests/geckodriver.log 2>&1 & #start server and run ui tests cargo run & +COUNT=0 #Wait for the server to start in port 8080 while netstat -lnt | awk '$4 ~ /:8080$/ {exit 1}'; do - if [ $SECONDS > 900 ] + #Wait for 15mins to start otherwise kill the task + if [ $COUNT -gt 90 ]; then exit 1 else + COUNT=$((COUNT+1)) sleep 10 fi done