Skip to content

fix(ci): count the task files a role's task file includes when dealing unit shards - #215

Merged
Mearman merged 1 commit into
mainfrom
ci/balance-unit-shards
Nov 4, 2026
Merged

Mearman merged 1 commit into
mainfrom
ci/balance-unit-shards

Conversation

@Mearman

@Mearman Mearman commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

The unit shard dealer (scripts/ci/shard_unit_tests.py) counted a playbook's include of a role task file as that file's own tasks only. The task files a test reaches through colima_size.yml, start_servers.yml and similar entry points (the turn, the quorum guard, the readiness wait) were never counted, so the modules that test them were dealt as light and piled into one shard: on #214's run the heaviest unit shard took 1.74 times the mean shard's job time and came close to the job's timeout.

A task file now counts what it includes by a literal name, looked for beside it and then in its role's tasks directory, recursively and counted once on a cycle. A role included with no tasks_from counts main.yml and what it includes, which is what Ansible runs, instead of every file of the role. An include whose tasks_from is {{ item }} over a literal loop list counts each file named.

Observed on this PR's own CI run against #214's (same runners, same tests): the heaviest unit shard's job time fell from 1.74 to 1.19 times the mean. What is left is mostly tests that wait out a readiness or command timeout on purpose (test_server_recreate, test_runtime_autostart), which no count of tasks or processes sees.

The test for playbook launches now covers a nested include, a looped tasks_from and the main.yml rule; with includes inside task files left unfollowed, it fails.

…g unit shards

The dealer counted only the tasks of the task file an include named,
so a test that ran colima_size.yml or start_servers.yml was charged for those files alone
and not for the turn, guard and readiness files they include.
Task files now count what they include by a literal name, found beside them or in the role's
tasks directory; a role included with no task file counts main.yml, as Ansible runs it;
and an include looping over literal task file names counts each of them.
@Mearman
Mearman marked this pull request as ready for review November 4, 2026 07:23
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-04T07:26:55.132310Z 0b60c1b Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Mearman
Mearman merged commit 7be9572 into main Nov 4, 2026
16 checks passed
@Mearman
Mearman deleted the ci/balance-unit-shards branch November 4, 2026 07:27
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.36.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant