mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
added 5 second rest every 100 tests
This commit is contained in:
parent
6c8080ef62
commit
6afd076005
1 changed files with 10 additions and 1 deletions
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue