From d2611b3cdddfc40c7b1308ddb1b96a696086db9f Mon Sep 17 00:00:00 2001 From: thelamer Date: Wed, 9 Jan 2019 18:06:52 -0800 Subject: [PATCH] adding some retry logic to the initial connect and upping timeouts across the board for grabbing a screenshot of the container --- ci/ci.py | 13 ++++++++++--- ci/results.template | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ci/ci.py b/ci/ci.py index e268d75..9a7eb5a 100755 --- a/ci/ci.py +++ b/ci/ci.py @@ -7,6 +7,8 @@ import sys import docker import requests import anybadge +from requests.adapters import HTTPAdapter +from requests.packages.urllib3.util.retry import Retry from multiprocessing.pool import Pool from selenium import webdriver from selenium.common.exceptions import ErrorInResponseException,TimeoutException @@ -234,9 +236,14 @@ def container_test(tag): chrome_options.add_argument('--headless') chrome_options.add_argument('--disable-gpu') chrome_options.add_argument('--window-size=1920x1080') - driver = webdriver.Chrome(chrome_options=chrome_options) - driver.set_page_load_timeout(10) - requests.get(endpoint, timeout=3) + chrome_options.add_argument('--delay=60') + driver = webdriver.Chrome(options=chrome_options) + driver.set_page_load_timeout(60) + session = requests.Session() + retries = Retry(total=4, backoff_factor=2, status_forcelist=[ 502, 503, 504 ]) + session.mount(proto, HTTPAdapter(max_retries=retries)) + session.get(endpoint) + time.sleep(10) driver.get(endpoint) driver.get_screenshot_as_file(outdir + tag + '.png') report_tests.append(['Screenshot ' + tag,'PASS']) diff --git a/ci/results.template b/ci/results.template index 6a77ca4..053bc5d 100755 --- a/ci/results.template +++ b/ci/results.template @@ -1,4 +1,4 @@ -# ![logo](https://ls-ci.nyc3.digitaloceanspaces.com/ls64x64.png) +# ![logo](https://www.linuxserver.io/static/logo-transparent-bg.87795b96.png) # Test Results {{ image }}:{{ meta_tag }} ## Cumulative: {{ report_status }}