Skip to content

Parallel tests#2190

Draft
Johan-Liebert1 wants to merge 7 commits into
bootc-dev:mainfrom
Johan-Liebert1:parallel-tests
Draft

Parallel tests#2190
Johan-Liebert1 wants to merge 7 commits into
bootc-dev:mainfrom
Johan-Liebert1:parallel-tests

Conversation

@Johan-Liebert1
Copy link
Copy Markdown
Collaborator

No description provided.

@Johan-Liebert1 Johan-Liebert1 added the ci/merge Run full CI suite (all OSes) — equivalent to merge queue label May 8, 2026
@bootc-bot bootc-bot Bot requested a review from cgwalters May 8, 2026 08:36
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the tmt test runner to support parallel execution of test plans using std::thread. It introduces a RunPlanResult struct and extracts the core test logic into a run_plan function. The review feedback identifies several opportunities for improvement, including addressing interleaved console output from concurrent threads, optimizing the thread-joining logic to avoid waiting for entire batches, handling potential panics when querying system parallelism, and removing redundant clones of owned objects.

Comment thread crates/xtask/src/tmt.rs
}
}

fn run_plan(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Running tests in parallel will cause their console output (from println!, eprintln!, and xshell commands) to interleave, making the logs difficult to read. Consider capturing the output per thread and printing it only when the test completes, or using a structured logging approach.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is an issue, but the final pass vs fail output is logged sequentially

Comment thread crates/xtask/src/tmt.rs Outdated
Comment thread crates/xtask/src/tmt.rs Outdated
Comment thread crates/xtask/src/tmt.rs Outdated
Comment thread crates/xtask/src/tmt.rs Outdated
@Johan-Liebert1 Johan-Liebert1 marked this pull request as draft May 8, 2026 08:48
Copy link
Copy Markdown
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without any kind of deeper review, I think what we really want to do is upstream into https://github.com/teemtee/tmt support for bcvk.

I believe it already has support for concurrency (I mean I'd hope) and such - and that would make it a lot more sustainable for other projects to use tmt+bcvk (and we have many in the ecosystem that would make sense to do so)

Comment thread .github/workflows/ci.yml
- uses: actions/checkout@v6
- name: Bootc Ubuntu Setup
uses: bootc-dev/actions/bootc-ubuntu-setup@main
uses: Johan-Liebert1/bootc-actions/bootc-ubuntu-setup@main
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could add an option to the action which fetches bcvk's binary built from git main or so

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that'd help

Comment thread crates/xtask/src/tmt.rs
Comment on lines +316 to +318
plan: String,
vm_name: String,
image: String,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style nit prefer &str

@Johan-Liebert1
Copy link
Copy Markdown
Collaborator Author

One or two test failures, but not as good of a speedup as I'd had locally. GA seems to have 4cpu

@cgwalters
Copy link
Copy Markdown
Collaborator

Yes, we can bump to larger runners though. I was experimenting with that previously in bootc-dev/ci-sandbox#1 but it's been a while

@Johan-Liebert1 Johan-Liebert1 added ci/tier-1 Run CI for tier-1 OS (centos-10) only and removed ci/merge Run full CI suite (all OSes) — equivalent to merge queue labels May 9, 2026
@Johan-Liebert1 Johan-Liebert1 force-pushed the parallel-tests branch 3 times, most recently from 5230a9f to a98f50a Compare May 11, 2026 10:41
@Johan-Liebert1
Copy link
Copy Markdown
Collaborator Author

Alright, so composefs integration tests now take ~30-40 mins instead of ~1hr - 1hr30min

Tests are still quite inconsistent tough. Especially the GC one randomly takes over 1000s to complete, dunno why. Needs some investigation

@Johan-Liebert1
Copy link
Copy Markdown
Collaborator Author

The ostree one takes around ~1hr instead of ~2h15min

Some tests are randomly taking a bit too long though

/tmt/plans/integration/plan-32-multi-device-esp: PASSED (1140.54328774s)

I'll try to debug this

@Johan-Liebert1 Johan-Liebert1 added ci/merge Run full CI suite (all OSes) — equivalent to merge queue and removed ci/tier-1 Run CI for tier-1 OS (centos-10) only labels May 11, 2026
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
We share host container storage in the VM, so we usually already have
localhost/bootc as an image in the VM. If we don't find it, only then
do we copy from ostree/composefs storage

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
So we don't spawn VMs for tests like "composefs-gc" just to do nothing
and exit

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Sort tests in descending order of time taken for completion so longer
tests get scheduled together. Also, update to use mpsc channels for
communication between threads

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/merge Run full CI suite (all OSes) — equivalent to merge queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants