File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 28
28
logger = logging .getLogger (__name__ )
29
29
30
30
JOB_COMPLETED = False
31
- MAX_RETRIES = 3
32
- MIN_TIME_SLEEP = 1
33
- MAX_TIME_SLEEP = 3
31
+ # if the log level is DEBUG we should never expect slow response so let's
32
+ # make the retries as small as posible
33
+ if logger .level == logging .DEBUG :
34
+ MAX_RETRIES = 1
35
+ MIN_TIME_SLEEP = 1
36
+ MAX_TIME_SLEEP = 2
37
+ else :
38
+ MAX_RETRIES = 3
39
+ MIN_TIME_SLEEP = 180
40
+ MAX_TIME_SLEEP = 3
34
41
BLANK_FILE_THRESHOLD = 100
35
42
36
43
Original file line number Diff line number Diff line change @@ -97,12 +97,15 @@ def test_format_payload_error(self):
97
97
98
98
class QiitaClientTests (PluginTestCase ):
99
99
def setUp (self ):
100
+ self .ca_cert = environ ['QIITA_ROOT_CA' ]
100
101
self .tester = QiitaClient ("https://localhost:21174" ,
101
102
CLIENT_ID ,
102
- CLIENT_SECRET )
103
+ CLIENT_SECRET ,
104
+ self .ca_cert )
103
105
self .bad_tester = QiitaClient ("https://localhost:21174" ,
104
106
BAD_CLIENT_ID ,
105
- CLIENT_SECRET )
107
+ CLIENT_SECRET ,
108
+ self .ca_cert )
106
109
self .clean_up_files = []
107
110
108
111
# making assertRaisesRegex compatible with Python 2.7 and 3.9
@@ -118,11 +121,11 @@ def test_init(self):
118
121
obs = QiitaClient ("https://localhost:21174" ,
119
122
CLIENT_ID ,
120
123
CLIENT_SECRET ,
121
- ca_cert = environ [ 'QIITA_ROOT_CA' ] )
124
+ ca_cert = self . ca_cert )
122
125
self .assertEqual (obs ._server_url , "https://localhost:21174" )
123
126
self .assertEqual (obs ._client_id , CLIENT_ID )
124
127
self .assertEqual (obs ._client_secret , CLIENT_SECRET )
125
- self .assertEqual (obs ._verify , environ [ 'QIITA_ROOT_CA' ] )
128
+ self .assertEqual (obs ._verify , self . ca_cert )
126
129
127
130
def test_get (self ):
128
131
obs = self .tester .get ("/qiita_db/artifacts/1/" )
You can’t perform that action at this time.
0 commit comments