
file_path="/tmp/product.json"

timeout=10


start_time=$(date +%s)

while [ $(($(date +%s) - start_time)) -lt $timeout ]; do
    if [ -f "$file_path" ]; then
        killall -9 main.sh
        killall -9 watch
        killall -9 boot_app
        killall -9 pile
        killall -9 quicknode
        /usr/app/quicknode/tests/867factory_test/run.sh &
        exit 0
    fi
    sleep 1
done

echo "no file exit product test"
exit 1