Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

make it easier to run component-async-tests with miri#216

Merged
dicej merged 2 commits into
mainfrom
dicej/miri-async-tests
Jun 16, 2025
Merged

make it easier to run component-async-tests with miri#216
dicej merged 2 commits into
mainfrom
dicej/miri-async-tests

Conversation

@dicej
Copy link
Copy Markdown
Collaborator

@dicej dicej commented Jun 13, 2025

This refactors the test harness a bit to allow running them under miri by first setting MIRI_TEST_CWASM_DIR to point to a directory, then running the tests without miri to populate that directory with .cwasm files as a side effect, and finally running the tests with miri, in which case they'll use the already-generated .cwasm files. This avoids the prohibitive cost of compiling significant amounts of guest code under miri.

For example:

mkdir cwasms
MIRI_TEST_CWASM_DIR=$(pwd)/cwasms
cargo test -p component-async-tests scenario::round_trip::async_round_trip_stackless -- --exact
MIRIFLAGS="-Zmiri-backtrace=full -Zmiri-disable-isolation -Zmiri-permissive-provenance"
cargo +nightly miri test -p component-async-tests scenario::round_trip::async_round_trip_stackless -- --exact

This refactors the test harness a bit to allow running them under miri by first
setting `MIRI_TEST_CWASM_DIR` to point to a directory, then running the tests
_without_ miri to populate that directory with .cwasm files as a side effect,
and finally running the tests _with_ miri, in which case they'll use the
already-generated .cwasm files.  This avoids the prohibitive cost of compiling
significant amounts of guest code under miri.

For example:

```
mkdir cwasms
MIRI_TEST_CWASM_DIR=$(pwd)/cwasms
cargo test -p component-async-tests scenario::round_trip::async_round_trip_stackless -- --exact
MIRIFLAGS="-Zmiri-backtrace=full -Zmiri-disable-isolation -Zmiri-permissive-provenance"
cargo +nightly miri test -p component-async-tests scenario::round_trip::async_round_trip_stackless -- --exact
```

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
@dicej dicej added this pull request to the merge queue Jun 15, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 15, 2025
@dicej dicej added this pull request to the merge queue Jun 16, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 16, 2025
This won't work on all platforms (e.g. 32-bit ones where Pulley is used).

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
@dicej dicej enabled auto-merge June 16, 2025 22:43
@dicej dicej added this pull request to the merge queue Jun 16, 2025
Merged via the queue into main with commit 3b91e3b Jun 16, 2025
44 checks passed
@dicej dicej deleted the dicej/miri-async-tests branch June 16, 2025 23:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant