Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion tests/commands/test_api_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import platform
import tempfile
import threading
import time
from http.server import HTTPServer, SimpleHTTPRequestHandler
from pathlib import Path
from unittest import mock
Expand Down Expand Up @@ -464,4 +465,11 @@ def test_all_workflow_when_server_down(self):
def assert_tracking_count(self, tracking, count: int):
# Prior to 3.6, `Response` object can't be obtained.
if compare_version([int(x) for x in platform.python_version().split('.')], [3, 7]) >= 0:
assert tracking.call_count == count
# Sometimes, `tracking.call_count` is not updated immediately. So, wait a moment until it is updated.
attempt = 0
while tracking.call_count < count:
time.sleep(0.1)
attempt += 1
if attempt > 10:
break
self.assertEqual(tracking.call_count, count)
4 changes: 2 additions & 2 deletions tests/utils/test_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def test_reason(self):

# use new session to disable retry
cli = _HttpClient(session=Session())
# /error is an actual endpoint that exists on our service to test the behavior
res = cli.request("GET", "intake/error")
# /raise_error is an actual endpoint that exists on our service to test the behavior
res = cli.request("GET", "intake/raise_error")
Copy link
Contributor Author

@ono-max ono-max Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yoshiori

FYI: Updated this endpoint because you modified the endpoint on the intake side.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this test is meaningless.
Please remove this test case

self.assertEqual(res.status_code, 500)
self.assertEqual(res.reason, "Welp")

Expand Down
Loading