Commit 959d6669 authored by Jérome Perrin's avatar Jérome Perrin

coverage_report: give up downloading before testnode restarts us

to make sure test terminates in case of problems with webdav server
parent 36596d56
......@@ -8,6 +8,7 @@ This file is used in two contexts:
"""
from __future__ import print_function
import datetime
import json
import logging
import os
......@@ -95,6 +96,10 @@ class CoverageReport(unittest.TestCase):
download_url_template = self._test_runner_configuration['coverage']['upload-url']
assert download_url_template
# erp5.util.testnode.ProcessManager applies a 4 hours MAX_TIMEOUT, give up
# before this timeout, otherwise this will be restarted forever in loop.
deadline = datetime.datetime.now() + datetime.timedelta(hours=3, minutes=30)
coverage_data_directory = os.path.join(log_directory, 'coverage_data')
if not os.path.exists(coverage_data_directory):
os.makedirs(coverage_data_directory)
......@@ -148,6 +153,8 @@ class CoverageReport(unittest.TestCase):
auth.__class__.__name__,
)
time.sleep(60 if resp.status_code == 404 else 5)
if datetime.datetime.now() > deadline:
raise TimeoutError()
return downloaded_coverage_path_set
def test_coverage_report(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment