-
Notifications
You must be signed in to change notification settings - Fork 159
Remove #[ignore] tests and GUEST env var, improve test ergonomics
#1196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
8314057 to
ef35afa
Compare
fc507ba to
d712ead
Compare
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
d712ead to
f92e7fe
Compare
…ent-safe Reduces thread count (20->10) and sandboxes per thread (50->20) so the test can run alongside other tests without exhausting system resources. Removes #[ignore] and the corresponding test-isolated entry in the Justfile. Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
f92e7fe to
b288516
Compare
#[ignore] tests and GUEST env var, improve test ergonomics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR improves Hyperlight’s test ergonomics and CI runtime by removing several #[ignore] tests (making them concurrency-safe), eliminating the GUEST={c,rust} env-var split, and introducing explicit “run with Rust/C/both guests” test helpers so integration tests only need a single run.
Changes:
- Replace
GUEST-based guest selection with explicit helpers (with_rust_*,with_c_*,with_all_*) and update host/integration tests accordingly. - Make previously-isolated tests safe to run in parallel (e.g., tracing interest caching workaround, shared-mem drop test, reduced sandbox stress test size).
- Improve test assertions/output (remove debug prints, add more informative assertion contexts) and adjust guest/test expectations (e.g.,
ExecuteOnHeapmessage).
Reviewed changes
Copilot reviewed 11 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/rust_guests/witguest/Cargo.lock | Bumps anyhow lockfile version for witguest test guest. |
| src/tests/rust_guests/simpleguest/src/main.rs | Changes ExecuteOnHeap success string to match updated host test expectations. |
| src/tests/rust_guests/simpleguest/Cargo.lock | Bumps anyhow lockfile version for simpleguest test guest. |
| src/tests/rust_guests/dummyguest/Cargo.lock | Bumps anyhow lockfile version for dummyguest test guest. |
| src/hyperlight_testing/src/tracing_subscriber.rs | Adds callsite Interest handling and span retrieval helper to stabilize parallel tracing tests. |
| src/hyperlight_host/tests/sandbox_host_tests.rs | Migrates tests to explicit guest helpers; removes per-test guest env handling/prints. |
| src/hyperlight_host/tests/integration_test.rs | Migrates integration tests to explicit guest helpers; makes execute_on_heap non-ignored and tests both feature paths. |
| src/hyperlight_host/tests/common/mod.rs | Introduces new sandbox helper APIs (rust-only, c-only, both). |
| src/hyperlight_host/src/testing/log_values.rs | Removes unused build-metadata testing helper module. |
| src/hyperlight_host/src/sandbox/uninitialized.rs | Makes test_trace_trace parallel-safe and removes #[ignore] by addressing tracing interest caching. |
| src/hyperlight_host/src/sandbox/initialized_multi_use.rs | Reduces sandbox creation stress test to 200 and removes #[ignore]. |
| src/hyperlight_host/src/mem/shared_mem.rs | Makes shared-mem drop test concurrency-safe and removes #[ignore] (Linux only, not miri). |
| src/hyperlight_host/src/mem/layout.rs | Moves/introduces max-memory test coverage at the layout layer. |
| Justfile | Removes duplicated integration test runs and updates test recipes to the new flow. |
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
Use Interest::sometimes() in TracingSubscriber to prevent the global interest cache from permanently caching Interest::never() when another thread's no-op subscriber registers callsites first. Add a warmup call + rebuild_interest_cache() to ensure callsites are properly registered before the real test run. Also removes the now-unused build_metadata_testing module and TestLogger dependency. Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
Replace the GUEST environment variable approach with explicit helper functions (with_rust_sandbox, with_c_sandbox, with_all_sandboxes, etc.) that make test intent clearer and remove runtime environment coupling. Each test now explicitly declares which guest(s) it needs. Tests that work with both guests use with_all_sandboxes to run against both Rust and C guests in a single test invocation, removing the need for separate test-integration runs per guest language. Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
Move the test from integration tests into the layout module where it belongs, and rewrite it to test SandboxMemoryLayout::get_memory_size directly instead of going through UninitializedSandbox::new. Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
…tests
Adds descriptive error messages to pattern-matching assertions so test failures show the actual value. Removes println!("{:?}", res) calls that were only useful for manual debugging.
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
b288516 to
89e52f7
Compare
Reduces
build-testCI step from around 20min to 10min!Makes several previously-isolated tests concurrent-safe so they no longer need
#[ignore]and separate CI runs:test_drop: use unique mapping size instead of address-based checkscreate_1000_sandboxes: reduce to 200 sandboxes, rename accordinglyexecute_on_heap: remove#[ignore], test both feature paths inlinetest_trace_trace: fixInterestcaching race withInterest::sometimes()and callsite warmupReplaces the
GUEST={c,rust}env var with explicit helpers (with_rust_sandbox,with_c_sandbox,with_all_sandboxes), so each test declares which guest(s) it needs andtest-integrationonly runs once. This reduces CI time by alot, since we're not accidentally running some tests twice (wit-tests, etc)Also improves
assert!(matches!())calls with error context and removes debugprintln!.Removes need for speciying GUEST={c,rust} when running integratiton tests. This will deduplicate a bunch of tests injust testand therefore CI, since we are currently accidentally running a bunch of tests that don't rely on c/rust guests twice for no reason.Certain tests still require #[ignore] (logging tests) but hopefully these can be removed soon as well. Please review PR commit-by-commit.
Todo in future PR: remove more duplicate tests when running tracing tests (runs all tests AGAIN, which is not needed)