added 5 second rest every 100 tests

This commit is contained in:
Jun-te Kim 2026-05-15 11:28:04 +00:00
parent 6c8080ef62
commit 6afd076005

View file

@ -12,12 +12,21 @@ FIXTURE_PATH = Path(__file__).parent / "test_data.csv"
# Each parametrized case fires at least one EPC request; without throttling,
# GitHub-hosted runners burst fast enough to hit 429s.
EPC_THROTTLE_SECONDS = 1.0
EPC_LONG_PAUSE_EVERY = 100
EPC_LONG_PAUSE_SECONDS = 5.0
_epc_request_count = 0
@pytest.fixture(autouse=True)
def _throttle_epc_requests():
global _epc_request_count
yield
time.sleep(EPC_THROTTLE_SECONDS)
_epc_request_count += 1
if _epc_request_count % EPC_LONG_PAUSE_EVERY == 0:
time.sleep(EPC_LONG_PAUSE_SECONDS)
else:
time.sleep(EPC_THROTTLE_SECONDS)
def load_test_cases():