Skip to content

Commit e8d0aa5

Browse files
test(platform): For stress test - 3h due date and deadline if test triggered in minute 40 to 49, 1k items if triggered in minute 0..9, triggering every 10 minutes, was every 5 minutes
1 parent 13b1d90 commit e8d0aa5

File tree

2 files changed

+38
-6
lines changed

2 files changed

+38
-6
lines changed

.github/workflows/stress-testing-staging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "+ Stress Testing / Staging (Every 15 minutes)"
22

33
on:
44
schedule:
5-
- cron: '*/5 * * * *'
5+
- cron: '*/10 * * * *'
66
workflow_dispatch:
77
inputs:
88
branch:

tests/aignostics/platform/e2e_test.py

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,11 @@
8686
# one application run starting every 5 minutes, with a throughput of 1 slide per minute,
8787
# given no GPU.
8888
SPECIAL_APPLICATION_SLIDE_PER_RUN_COUNT = 100
89+
SPECIAL_APPLICATION_SLIDE_PER_RUN_COUNT_ON_00 = 1000
8990
SPECIAL_APPLICATION_SUBMIT_AND_FIND_DUE_DATE_SECONDS = 60 * 60 * 24 # 1 day(s)
9091
SPECIAL_APPLICATION_SUBMIT_AND_FIND_DEADLINE_SECONDS = 60 * 60 * 24 # 1 day(s)
92+
SPECIAL_APPLICATION_SUBMIT_AND_FIND_DUE_DATE_SECONDS_ON_40 = 60 * 60 * 3 # 3 hours
93+
SPECIAL_APPLICATION_SUBMIT_AND_FIND_DEADLINE_SECONDS_ON_40 = 60 * 60 * 3 # 3 hours
9194
SPECIAL_APPLICATION_SUBMIT_AND_FIND_SUBMIT_TIMEOUT_SECONDS = 60 * 30 # 30 minutes
9295
SPECIAL_APPLICATION_FIND_AND_VALIDATE_TIMEOUT_SECONDS = 60 * 60 # 60 minutes
9396

@@ -588,24 +591,53 @@ def test_platform_special_app_submit() -> None:
588591
589592
This test submits an application run with the special application and validates the submission.
590593
594+
The test behavior varies based on the current minute when triggered by cron (*/10):
595+
- Minutes 0-9 (every 6th run): Uses 1000 items instead of 100
596+
- Minutes 40-49 (every 4th run): Uses 3h due date/deadline instead of 24h
597+
591598
Raises:
592599
AssertionError: If any of the validation checks fail.
593600
"""
601+
# Determine run configuration based on current minute
602+
# Cron runs every 10 minutes (*/10, in _scheduled-test-stress.yml),
603+
# so we check which 10-minute window we're in
604+
current_minute = datetime.now(tz=UTC).minute
605+
is_on_00 = 0 <= current_minute <= 9
606+
is_on_40 = 40 <= current_minute <= 49
607+
608+
slide_count = SPECIAL_APPLICATION_SLIDE_PER_RUN_COUNT_ON_00 if is_on_00 else SPECIAL_APPLICATION_SLIDE_PER_RUN_COUNT
609+
610+
deadline_seconds = (
611+
SPECIAL_APPLICATION_SUBMIT_AND_FIND_DEADLINE_SECONDS_ON_40
612+
if is_on_40
613+
else SPECIAL_APPLICATION_SUBMIT_AND_FIND_DEADLINE_SECONDS
614+
)
615+
due_date_seconds = (
616+
SPECIAL_APPLICATION_SUBMIT_AND_FIND_DUE_DATE_SECONDS_ON_40
617+
if is_on_40
618+
else SPECIAL_APPLICATION_SUBMIT_AND_FIND_DUE_DATE_SECONDS
619+
)
620+
621+
logger.info(
622+
f"Special app submit config: minute={current_minute}, is_on_00={is_on_00}, is_on_40={is_on_40}, "
623+
f"slide_count={slide_count}, deadline_seconds={deadline_seconds}, due_date_seconds={due_date_seconds}"
624+
)
625+
594626
logger.trace(
595-
f"Generating special application payload with {SPECIAL_APPLICATION_SLIDE_PER_RUN_COUNT} spots for "
627+
f"Generating special application payload with {slide_count} spots for "
596628
f"{SPECIAL_APPLICATION_ID} version {SPECIAL_APPLICATION_VERSION}"
597629
)
598630
payload = _get_spots_payload_for_special(
599-
expires_seconds=SPECIAL_APPLICATION_SUBMIT_AND_FIND_DEADLINE_SECONDS + 60 * 5,
600-
count=SPECIAL_APPLICATION_SLIDE_PER_RUN_COUNT,
631+
expires_seconds=deadline_seconds + 60 * 5,
632+
count=slide_count,
601633
)
602634
logger.debug(f"Generated special application payload: {payload}")
603635
_submit_and_validate(
604636
application_id=SPECIAL_APPLICATION_ID,
605637
application_version=SPECIAL_APPLICATION_VERSION,
606638
payload=payload,
607-
deadline_seconds=SPECIAL_APPLICATION_SUBMIT_AND_FIND_DEADLINE_SECONDS,
608-
due_date_seconds=SPECIAL_APPLICATION_SUBMIT_AND_FIND_DUE_DATE_SECONDS,
639+
deadline_seconds=deadline_seconds,
640+
due_date_seconds=due_date_seconds,
609641
tags={"test_platform_special_app_submit", "special", "stress", "stress_only"},
610642
)
611643
logger.debug("Special application payload submitted successfully")

0 commit comments

Comments
 (0)