Skip to content

Commit adfdc37

Browse files
authored
Merge pull request #1135 from cloudbees-oss/fix-ci-4
Fix CI on the v1 branch
2 parents e986505 + e93eed7 commit adfdc37

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

tests/commands/test_api_error.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import platform
44
import tempfile
55
import threading
6+
import time
67
from http.server import HTTPServer, SimpleHTTPRequestHandler
78
from pathlib import Path
89
from unittest import mock
@@ -464,4 +465,11 @@ def test_all_workflow_when_server_down(self):
464465
def assert_tracking_count(self, tracking, count: int):
465466
# Prior to 3.6, `Response` object can't be obtained.
466467
if compare_version([int(x) for x in platform.python_version().split('.')], [3, 7]) >= 0:
467-
assert tracking.call_count == count
468+
# Sometimes, `tracking.call_count` is not updated immediately. So, wait a moment until it is updated.
469+
attempt = 0
470+
while tracking.call_count < count:
471+
time.sleep(0.1)
472+
attempt += 1
473+
if attempt > 10:
474+
break
475+
self.assertEqual(tracking.call_count, count)

tests/utils/test_http_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def test_reason(self):
5151

5252
# use new session to disable retry
5353
cli = _HttpClient(session=Session())
54-
# /error is an actual endpoint that exists on our service to test the behavior
55-
res = cli.request("GET", "intake/error")
54+
# /raise_error is an actual endpoint that exists on our service to test the behavior
55+
res = cli.request("GET", "intake/raise_error")
5656
self.assertEqual(res.status_code, 500)
5757
self.assertEqual(res.reason, "Welp")
5858

0 commit comments

Comments
 (0)