mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-13 15:37:02 +00:00
autopkgtest: Add some retry logic
This commit is contained in:
parent
63324d48a8
commit
a46ea8d3e5
@ -25,6 +25,8 @@ import re
|
||||
import sys
|
||||
import urllib.parse
|
||||
import requests
|
||||
from requests.adapters import HTTPAdapter
|
||||
from requests.packages.urllib3.util.retry import Retry
|
||||
|
||||
import apt_pkg
|
||||
import amqplib.client_0_8 as amqp
|
||||
@ -85,6 +87,10 @@ class AutopkgtestPolicy(BasePolicy):
|
||||
self.results_cache_file = os.path.join(self.test_state_dir, 'results.cache')
|
||||
|
||||
self.session = requests.Session()
|
||||
retry = Retry(total=3, read=3, connect=3)
|
||||
adapter = HTTPAdapter(max_retries=retry)
|
||||
self.session.mount('http://', adapter)
|
||||
self.session.mount('https://', adapter)
|
||||
|
||||
try:
|
||||
self.options.adt_ppas = self.options.adt_ppas.strip().split()
|
||||
|
Loading…
x
Reference in New Issue
Block a user