|
86 | 86 | # one application run starting every 5 minutes, with a throughput of 1 slide per minute, |
87 | 87 | # given no GPU. |
88 | 88 | SPECIAL_APPLICATION_SLIDE_PER_RUN_COUNT = 100 |
| 89 | +SPECIAL_APPLICATION_SLIDE_PER_RUN_COUNT_ON_00 = 1000 |
89 | 90 | SPECIAL_APPLICATION_SUBMIT_AND_FIND_DUE_DATE_SECONDS = 60 * 60 * 24 # 1 day(s) |
90 | 91 | 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 |
91 | 94 | SPECIAL_APPLICATION_SUBMIT_AND_FIND_SUBMIT_TIMEOUT_SECONDS = 60 * 30 # 30 minutes |
92 | 95 | SPECIAL_APPLICATION_FIND_AND_VALIDATE_TIMEOUT_SECONDS = 60 * 60 # 60 minutes |
93 | 96 |
|
@@ -588,24 +591,53 @@ def test_platform_special_app_submit() -> None: |
588 | 591 |
|
589 | 592 | This test submits an application run with the special application and validates the submission. |
590 | 593 |
|
| 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 | +
|
591 | 598 | Raises: |
592 | 599 | AssertionError: If any of the validation checks fail. |
593 | 600 | """ |
| 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 | + |
594 | 626 | 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 " |
596 | 628 | f"{SPECIAL_APPLICATION_ID} version {SPECIAL_APPLICATION_VERSION}" |
597 | 629 | ) |
598 | 630 | 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, |
601 | 633 | ) |
602 | 634 | logger.debug(f"Generated special application payload: {payload}") |
603 | 635 | _submit_and_validate( |
604 | 636 | application_id=SPECIAL_APPLICATION_ID, |
605 | 637 | application_version=SPECIAL_APPLICATION_VERSION, |
606 | 638 | 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, |
609 | 641 | tags={"test_platform_special_app_submit", "special", "stress", "stress_only"}, |
610 | 642 | ) |
611 | 643 | logger.debug("Special application payload submitted successfully") |
|
0 commit comments