Skip to content

Use nextest to run Miri in CI#9629

Merged
alamb merged 3 commits intoapache:mainfrom
AdamGS:adamg/use-nextest-miri
Apr 1, 2026
Merged

Use nextest to run Miri in CI#9629
alamb merged 3 commits intoapache:mainfrom
AdamGS:adamg/use-nextest-miri

Conversation

@AdamGS
Copy link
Copy Markdown
Contributor

@AdamGS AdamGS commented Mar 30, 2026

Which issue does this PR close?

  • Closes #NNN.

Rationale for this change

Miri in CI is VERY slow (around 2.5 hours), but the github runners actually have 4 vCPUs and some memory, so using nextest can give us some speedup.

What changes are included in this PR?

Install nextest in CI and then use it to run Miri

Are these changes tested?

tested the script locally

Are there any user-facing changes?

No

@AdamGS
Copy link
Copy Markdown
Contributor Author

AdamGS commented Mar 30, 2026

another benefit here is just seeing the impact on overall runtime of individual tests under miri

@AdamGS
Copy link
Copy Markdown
Contributor Author

AdamGS commented Mar 30, 2026

I've pushed another change that runs all crates in a single invocation so nextest can better parallelize between the crates, it seems like just test_from_bitwise_binary_op takes around 40% of the overall runtime.

@AdamGS
Copy link
Copy Markdown
Contributor Author

AdamGS commented Mar 30, 2026

Locally this PR takes the runtime to around ~5 minutes for all but the following tests (obviously also because its a much more powerful machine). The 3 slowest tests are:

  1. test_from_bitwise_binary_op in arrow-buffer
  2. sort::tests::fuzz_partition_validity in arrow-ord
  3. sort::tests::test_fuzz_random_strings in arrow-ord

I think the first can be specialized into less cases with a cfg(miri), and the latter two can just be ignored on miri, but would love some feedback about the overall change.

edit: FWIW - this change as is and end-to-end also saves around 30 minutes.

Copy link
Copy Markdown
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @AdamGS -- my only concern is the use of the github action

I also reviewed the timings and this PR does help shave about 30 minutes off the run:

This PR (1h 57m 27s): https://github.com/apache/arrow-rs/actions/runs/23751988211/job/69196496005?pr=9629

Main (2h 29m 46s): https://github.com/apache/arrow-rs/actions/runs/23801294865/job/69362162088

cargo miri test -p arrow-ord
cargo miri test -p arrow-array
cargo miri test -p arrow-arith No newline at end of file
cargo miri nextest run \
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.

Copy link
Copy Markdown
Contributor Author

@AdamGS AdamGS Apr 1, 2026

Choose a reason for hiding this comment

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

nextest is probably the most important non built in tool working in rust for my workflow

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.

sqllogictest is mine 😉

rustup toolchain install nightly --component miri
rustup override set nightly
cargo miri setup
- name: Set up nextest
Copy link
Copy Markdown
Contributor

@alamb alamb Mar 31, 2026

Choose a reason for hiding this comment

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

This action scares me security wise (as it runs some bash script)
https://github.com/apache/arrow-rs/actions/runs/23751988211/job/69196496005?pr=9629

I think it would be better (if not ideal) to install nextest explicitly (cargo install cargo-nextest --version 0.9.132 --locked) rather than use this pre-built binary

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.

yeah absolutely, I'll change it.
How would you feel ignoring those long tests and minimizing the first one? I think it might shave the runtime here significantly

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.

How would you feel ignoring those long tests and minimizing the first one? I think it might shave the runtime here significantly

Let's do it

maybe we can make a separate PR to do so (so we can review the changes in isolation)

Copy link
Copy Markdown
Contributor Author

@AdamGS AdamGS Apr 1, 2026

Choose a reason for hiding this comment

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

SGTM, 3b003ec just installs nextest using cargo install with a locked version, once this merges I'll open up a follow up.

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.

It seems like this adds 3 minutes to the job

https://github.com/apache/arrow-rs/actions/runs/23844918251/job/69509710473?pr=9629

Image

However, we are ahead of where main is

Copy link
Copy Markdown
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @AdamGS

cargo miri test -p arrow-ord
cargo miri test -p arrow-array
cargo miri test -p arrow-arith No newline at end of file
cargo miri nextest run \
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.

sqllogictest is mine 😉

rustup toolchain install nightly --component miri
rustup override set nightly
cargo miri setup
- name: Set up nextest
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.

It seems like this adds 3 minutes to the job

https://github.com/apache/arrow-rs/actions/runs/23844918251/job/69509710473?pr=9629

Image

However, we are ahead of where main is

@alamb alamb merged commit f5365c3 into apache:main Apr 1, 2026
34 checks passed
@alamb alamb added the development-process Related to development process of arrow-rs label Apr 1, 2026
@AdamGS AdamGS deleted the adamg/use-nextest-miri branch April 1, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

development-process Related to development process of arrow-rs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants