Skip to content

Conversation

dcantah
Copy link
Member

@dcantah dcantah commented Oct 10, 2025

Today all of the tests are ran serially which on an M1 Max comes out to usually around 30+ seconds for me. This seems much too long to wait for what these tests actually do.. There was one decent deterrent in the way of getting these to actually run concurrently however, which is that today every test uses the exact same image, and it is unpacked every single time in the bootstrap method. Every invocation after the first doesn't actually re-unpack the image, as the logic for "is this unpacked" is just a stat on the path, but what this means once we try and run the same on > 1 thread is they will all compete with each other on unpacking, and sometimes (almost always) trample over each other. This can result in guests trying to mount a faulty filesystem:

[ 0.303404] EXT4-fs (vdb): VFS: Can't find ext4 filesystem

Ideally we have API to handle this, but for now I've invented a shoddy unpack coordinator type that just keys off of a path and halts any other threads if an unpack for that path is already in progress.

Timings (10 runs, image already pulled, max concurrency == 8):

New avg: 11s
Old Avg: 31s

Today all of the tests are ran serially which on an M1 Max comes out to
usually around 30+ seconds for me. This seems much too long to wait
for what these tests actually do.. There was one decent deterrent in
the way of getting these to actually run concurrently however, which is
that today every test uses the exact same image, and it is unpacked
every single time in the `bootstrap` method. Every invocation after the
first doesn't actually re-unpack the image, as the logic for "is this unpacked"
is just a stat on the path, but what this means once we try and run the
same on > 1 thread is they will all compete with each other on unpacking,
and sometimes (almost always) trample over each other. This can result in guests
trying to mount a faulty filesystem:

[    0.303404] EXT4-fs (vdb): VFS: Can't find ext4 filesystem

Ideally we have API to handle this, but for now I've invented a shoddy unpack coordinator
type that just keys off of a path and halts any other threads if an unpack for that
path is already in progress.

Timings (10 runs, image already pulled, max concurrency == 8):

New avg: 11s
Old Avg: 31s
@dcantah dcantah force-pushed the integration-tests-concurrent branch from 6369a8a to f75092b Compare October 10, 2025 08:47
Copy link
Contributor

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

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

Nice 👍

@dcantah dcantah merged commit 6e96cdb into apple:main Oct 10, 2025
2 checks passed
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.

2 participants