From 0e83b888a86124c173c7b291f9da853902091eeb Mon Sep 17 00:00:00 2001 From: Bruno Postle Date: Fri, 10 Apr 2026 00:47:12 +0100 Subject: [PATCH] bsdd: fix CI test failure by spacing API calls 3s apart The retry logic alone is not sufficient: back-to-back calls can exhaust the retry budget before the rate limit window resets. Sleep 3s between each module-level prefetch call (the API limit is ~1 req/2s). Generated with the assistance of an AI coding tool. --- src/bsdd/tests/test_bsdd.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bsdd/tests/test_bsdd.py b/src/bsdd/tests/test_bsdd.py index 7d975a2da0..d6f4d39725 100644 --- a/src/bsdd/tests/test_bsdd.py +++ b/src/bsdd/tests/test_bsdd.py @@ -1,19 +1,27 @@ +import time + from bsdd import Client client = Client() # Fetch shared data at module level to avoid repeated API calls during tests. -# The Client.get() method handles 429 rate-limit responses with automatic retry. +# Sleep 3s between calls: the bSDD API rate-limits to ~1 req/2s, and Client.get() +# retries on 429, but back-to-back calls without spacing still exhaust the retry budget. _dictionaries = client.get_dictionary()["dictionaries"] ifc4x3_uri = next(l["uri"] for l in _dictionaries if "4.3" in l["uri"]) nbs_uri = next(l["uri"] for l in _dictionaries if "Uniclass 2015" == l["name"]) +time.sleep(3) _ifc4x3_classes = client.get_classes(ifc4x3_uri, use_nested_classes=False, class_type="Class") +time.sleep(3) _nbs_classes = client.get_classes(nbs_uri, use_nested_classes=False, class_type="Class", offset=0, limit=5) _uri_light_fixture = next(l for l in _ifc4x3_classes["classes"] if "IfcLightFixture" == l["code"])["uri"] +time.sleep(3) _light_fixture = client.get_class(_uri_light_fixture) +time.sleep(3) _light_fixture_relations = client.get_class_relations(_uri_light_fixture) +time.sleep(3) _light_fixture_properties = client.get_class_properties(_uri_light_fixture)