Skip to content

Add parallel execution mode for integration tests#3522

Merged
rnro merged 5 commits intoapple:mainfrom
rnro:integration_tests_in_parallel
Feb 27, 2026
Merged

Add parallel execution mode for integration tests#3522
rnro merged 5 commits intoapple:mainfrom
rnro:integration_tests_in_parallel

Conversation

@rnro
Copy link
Copy Markdown
Contributor

@rnro rnro commented Feb 24, 2026

Add parallel execution mode for integration tests

Motivation:

Integration tests regularly take 21m in CI; they're the long pole.

Modifications:

  • Allocation count tests are now run in parallel if
    NIO_ALLOC_COUNTER_TESTS_PARALLEL is true, tests in a given file
    are still in serial.
  • Test output is catted to different files and recovered and printed in
    the order in which the tests were started.

Result:

Integration test execution (and therefore a PR's CI checks) goes from 21m to 10m

@rnro rnro force-pushed the integration_tests_in_parallel branch from ccd8798 to 4413730 Compare February 24, 2026 17:45
@rnro rnro changed the title WIP Add parallel execution mode for integration tests Feb 24, 2026
@rnro rnro added the semver/none No version bump required. label Feb 24, 2026
Motivation:

Integration tests regularly take 21m in CI; they're the long pole.

Modifications:

* Allocation count tests are now run in parallel if
  `NIO_ALLOC_COUNTER_TESTS_PARALLEL` is `true`, tests in a given file
  are still in serial.
* Test output is catted to different files and recovered and printed in
  the order in which the tests were started.

Result:

Integration test execution goes from 21m to 10m
@rnro rnro force-pushed the integration_tests_in_parallel branch from 4413730 to eb22daf Compare February 24, 2026 17:49
@rnro rnro marked this pull request as ready for review February 24, 2026 17:59
Comment on lines +306 to +307
echo "- ${files[$i]}"
cat "$out_dir/$module"
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.

Why is this going to stdout but the other branch going to stderr?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the intended output of the script which I believe always went to stdout, the other path represents a failure case so it goes to stderr so as not mess with any parsing of the script output

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.

Logging should go to stderr. Output that's consumed by another process should go to stdout. It's not clear why the new stuff is going to stderr IMO. I'd expect a downstream tool to see all the modules that ran and whether they passed or failed, not just the ones that passed.

@@ -289,8 +289,33 @@ build_package \
set -eu
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.

This used to exit if a swift run command failed.

Are we sure it does now since the wait is in an if

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think it will now, we won't early exit, we'll keep going and try every file. I'm not sure this is worse, but it is different, I can look at changing it if you'd like.

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.

I'm less concerned with whether we exit early, but IIUC this now changes whether we exit non-zero or not if one of the runs fails. We used to do that implicitly with the -e, on the first fail, because they were being run in serial. Now they're being run in parallel it's harder to reason about. I can see it sets all_ok=false if there's a failure, but is something checking this?

Can we just confirm that this fails as expected when there's a failure?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have tweaked this (because the other solution didn't get on well on my Mac's version of bash) and confirmed by running a script with this code snippet that failing and succeeding commands are handled as expected.

@rnro rnro requested a review from simonjbeaumont February 26, 2026 10:42
@rnro rnro merged commit fb69e42 into apple:main Feb 27, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants