Skip to content

Run tests in parallel with ParallelTestRunner (Take 2) - #179

Open
christiangnrd wants to merge 13 commits into
mainfrom
ptrptr
Open

Run tests in parallel with ParallelTestRunner (Take 2)#179
christiangnrd wants to merge 13 commits into
mainfrom
ptrptr

Conversation

@christiangnrd

Copy link
Copy Markdown
Collaborator

#178 was automatically closed when I force-pushed to rebase #176 on top of #178 (instead of the other way around)

@giordano I think this is more straightforward than #176, but will cause more conflicts, so it should probably be merged first.

christiangnrd and others added 10 commits September 3, 2026 10:13
Split `test/runtests.jl` into per-topic files (core, workers, failures,
output, unit, serial, retries) that `runtests(ParallelTestRunner, ARGS)`
discovers and runs in parallel workers. Each file's sandbox gets
ParallelTestRunner, Test and `utils.jl` via `init_code`.

Adjustments needed because the tests now run in worker sandboxes:
- The sample test files used by the "basic use" and "subdir use" tests
  moved to `test/sample_tests/`, which is excluded from discovery and
  passed explicitly, so nested runs don't recurse into the real suite.
- The custom record type is evaluated into `Main` (as on the workers)
  so it deserializes; a bare `eval` would land in the sandbox module.
- `Base.ARGS` in the custom-worker shutdown test replaced with `String[]`.
- `@show_if_error` moved to `utils.jl` so every sandbox has it.
- The "no workers running" check stays in `runtests.jl`, after the outer
  run, so it checks the main process rather than a single worker.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This reverts commit 5c5ba64, dropping the
debugging println(str) lines from the serial and workers test files.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@giordano giordano left a comment

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 have the vague recollection @vchuravy used to have some reservations about running the tests with ParallelTestRunner itself, but perhaps this package now is maturing enough to eat its own dog food.

Comment thread .github/workflows/UnitTests.yml Outdated
Comment thread test/runtests.jl
Co-authored-by: Mosè Giordano <765740+giordano@users.noreply.github.com>
@giordano

giordano commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

How come the diff is +1,623/-1,700? I'd expect to slightly increase number of lines, not to lose them (as much as I like deleting code, I'm suspicious when this happens in tests)

@christiangnrd

Copy link
Copy Markdown
Collaborator Author

I have the vague recollection @vchuravy used to have some reservations about running the tests with ParallelTestRunner itself, but perhaps this package now is maturing enough to eat its own dog food.

Was this maybe when we were using Distributed?

How come the diff is +1,623/-1,700?

I did a bit of combining testsets to reduce cold worker start times since they're super high on x86 runners. Maybe this should be a follow-up PR, but I split up each change in its own commit to hopefully make it easier to review (3b877c8 to e18227f)

@giordano

giordano commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

I have the vague recollection @vchuravy used to have some reservations about running the tests with ParallelTestRunner itself, but perhaps this package now is maturing enough to eat its own dog food.

Was this maybe when we were using Distributed?

Quite possibly.

How come the diff is +1,623/-1,700?

I did a bit of combining testsets to reduce cold worker start times since they're super high on x86 runners. Maybe this should be a follow-up PR, but I split up each change in its own commit to hopefully make it easier to review (3b877c8 to e18227f)

👍

@giordano giordano left a comment

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.

If @vchuravy has no objections, this is good from my point of view

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