Skip to content

Commit 2bce80d

Browse files
chore(internal): codegen related update (#92)
1 parent 7dde411 commit 2bce80d

2 files changed

Lines changed: 26 additions & 26 deletions

File tree

src/runloop_api_client/_constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
DEFAULT_MAX_RETRIES = 0
1111
DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20)
1212

13-
INITIAL_RETRY_DELAY = 0.5
14-
MAX_RETRY_DELAY = 8.0
13+
INITIAL_RETRY_DELAY = 1.0
14+
MAX_RETRY_DELAY = 5.0

tests/test_client.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -706,20 +706,20 @@ class Model(BaseModel):
706706
"remaining_retries,retry_after,timeout",
707707
[
708708
[3, "20", 20],
709-
[3, "0", 0.5],
710-
[3, "-10", 0.5],
709+
[3, "0", 1],
710+
[3, "-10", 1],
711711
[3, "60", 60],
712-
[3, "61", 0.5],
712+
[3, "61", 1],
713713
[3, "Fri, 29 Sep 2023 16:26:57 GMT", 20],
714-
[3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5],
715-
[3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5],
714+
[3, "Fri, 29 Sep 2023 16:26:37 GMT", 1],
715+
[3, "Fri, 29 Sep 2023 16:26:27 GMT", 1],
716716
[3, "Fri, 29 Sep 2023 16:27:37 GMT", 60],
717-
[3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5],
718-
[3, "99999999999999999999999999999999999", 0.5],
719-
[3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5],
720-
[3, "", 0.5],
721-
[2, "", 0.5 * 2.0],
722-
[1, "", 0.5 * 4.0],
717+
[3, "Fri, 29 Sep 2023 16:27:38 GMT", 1],
718+
[3, "99999999999999999999999999999999999", 1],
719+
[3, "Zun, 29 Sep 2023 16:26:27 GMT", 1],
720+
[3, "", 1],
721+
[2, "", 1 * 2.0],
722+
[1, "", 1 * 4.0],
723723
],
724724
)
725725
@mock.patch("time.time", mock.MagicMock(return_value=1696004797))
@@ -729,7 +729,7 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str
729729
headers = httpx.Headers({"retry-after": retry_after})
730730
options = FinalRequestOptions(method="get", url="/foo", max_retries=3)
731731
calculated = client._calculate_retry_timeout(remaining_retries, options, headers)
732-
assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType]
732+
assert calculated == pytest.approx(timeout, 1 * 0.875) # pyright: ignore[reportUnknownMemberType]
733733

734734
@mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
735735
@pytest.mark.respx(base_url=base_url)
@@ -1442,20 +1442,20 @@ class Model(BaseModel):
14421442
"remaining_retries,retry_after,timeout",
14431443
[
14441444
[3, "20", 20],
1445-
[3, "0", 0.5],
1446-
[3, "-10", 0.5],
1445+
[3, "0", 1],
1446+
[3, "-10", 1],
14471447
[3, "60", 60],
1448-
[3, "61", 0.5],
1448+
[3, "61", 1],
14491449
[3, "Fri, 29 Sep 2023 16:26:57 GMT", 20],
1450-
[3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5],
1451-
[3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5],
1450+
[3, "Fri, 29 Sep 2023 16:26:37 GMT", 1],
1451+
[3, "Fri, 29 Sep 2023 16:26:27 GMT", 1],
14521452
[3, "Fri, 29 Sep 2023 16:27:37 GMT", 60],
1453-
[3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5],
1454-
[3, "99999999999999999999999999999999999", 0.5],
1455-
[3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5],
1456-
[3, "", 0.5],
1457-
[2, "", 0.5 * 2.0],
1458-
[1, "", 0.5 * 4.0],
1453+
[3, "Fri, 29 Sep 2023 16:27:38 GMT", 1],
1454+
[3, "99999999999999999999999999999999999", 1],
1455+
[3, "Zun, 29 Sep 2023 16:26:27 GMT", 1],
1456+
[3, "", 1],
1457+
[2, "", 1 * 2.0],
1458+
[1, "", 1 * 4.0],
14591459
],
14601460
)
14611461
@mock.patch("time.time", mock.MagicMock(return_value=1696004797))
@@ -1466,7 +1466,7 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte
14661466
headers = httpx.Headers({"retry-after": retry_after})
14671467
options = FinalRequestOptions(method="get", url="/foo", max_retries=3)
14681468
calculated = client._calculate_retry_timeout(remaining_retries, options, headers)
1469-
assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType]
1469+
assert calculated == pytest.approx(timeout, 1 * 0.875) # pyright: ignore[reportUnknownMemberType]
14701470

14711471
@mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
14721472
@pytest.mark.respx(base_url=base_url)

0 commit comments

Comments
 (0)