Skip to content

Drop build size from test task priorities - #245

Merged
anfimovdm merged 1 commit into
clfrom
al-alts-simplify-priorities
Nov 5, 2026
Merged

anfimovdm merged 1 commit into
clfrom
al-alts-simplify-priorities

Conversation

@anfimovdm

Copy link
Copy Markdown
Contributor

Summary

Test task priorities no longer depend on build size. Release builds now come first and all other builds share one priority. Release builds already get their own cost queues (#244), so splitting the rest by size isn't needed anymore.

Priority Before After
0 MANUAL, never sent by the scheduler RESERVED, never sent by the scheduler
1 RELEASE_BUILD RELEASE_BUILD
2 SMALL_BUILD (≤ small_build_max_tasks test tasks) REGULAR_BUILD (all other builds; also the default priority)
3 LARGE_BUILD —

Changes

  • alts/shared/constants.py: TaskPriority is now RESERVED = 0, RELEASE_BUILD = 1, REGULAR_BUILD = 2.
  • alts/shared/models.py: task_default_priority is REGULAR_BUILD. Redis priority_steps follows TaskPriority, so it becomes [0, 1, 2]. SchedulerConfig.small_build_max_tasks is removed. If a config still sets it, the key is ignored and the scheduler starts normally.
  • alts/scheduler/scheduling.py: get_task_priority(release_build) only looks at the release flag. The build_tasks_count argument of schedule_test_task() and the per-poll task counting in run() are removed.
  • tests/scheduler/test_scheduling.py: tests updated.

Deploy notes

  • Deploying only the scheduler is enough to apply the new priorities. Workers still running the old code read priority lists 0–3, which covers the new values.
  • Before redeploying workers, empty the <queue>:3 lists. Large-build tasks sent by the old scheduler are waiting there. Workers with this code only read lists 0–2, so anything left in :3 would never be picked up. Release tasks (:1) and small-build tasks (:2) are already in lists the new workers read.

Testing

  • CELERY_CONFIG_PATH=tests/tests_config.yaml SCHEDULER_CONFIG_PATH=tests/tests_config.yaml pytest tests/ --deselect tests/executors: 104 passed, 6 skipped. The executor tests need a local SSH server (CI runs one in the container), so they were left out locally.
  • The tests cover:
    • only the release flag sets the priority, for both runners and for builds of 1 and 50 tasks;
    • the priority order is reserved < release < regular;
    • Redis priority_steps lists every TaskPriority value, and the default priority is REGULAR_BUILD.
  • Celery and the scheduler DB are mocked; no real broker, Docker or OpenNebula run.

🤖 Generated with Claude Code

Priorities are now: 0 reserved for tasks routed by hand (never sent by
the scheduler), 1 for release builds, 2 for all other builds. Small and
large builds no longer get different priorities, so the
small_build_max_tasks option is removed.
@anfimovdm
anfimovdm merged commit 5c1d2e2 into cl Nov 5, 2026
2 of 3 checks passed
@anfimovdm
anfimovdm deleted the al-alts-simplify-priorities branch November 5, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant