Skip to content

Commit 47bc186

Browse files
authored
Skip some tests with ASAN (#11399)
ASAN is the longest builder right now and many of the slow tests aren't really buying much such as: * `disas` - no `unsafe` code * `wast` - no need to test all permutations of compilers/collectors and instead one should suffice * `all` - various tests taking 1m+ were flagged to ignore under ASAN as it's not necessarily important to run 100% of tests under ASAN.
1 parent a94233d commit 47bc186

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

tests/all/code_too_large.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ use wasmtime::*;
55

66
#[test]
77
fn code_too_large_without_panic() -> Result<()> {
8+
// This takes 1m+ in ASAN and isn't too useful to test in ASAN.
9+
if cfg!(asan) {
10+
return Ok(());
11+
}
12+
813
const N: usize = 80000;
914

1015
// Build a module with a function whose body will allocate too many

tests/all/stack_overflow.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ fn host_always_has_some_stack() -> Result<()> {
122122

123123
#[wasmtime_test]
124124
fn big_stack_works_ok(config: &mut Config) -> Result<()> {
125+
// This test takes 1m+ in ASAN and isn't too useful, so prune it.
126+
if cfg!(asan) {
127+
return Ok(());
128+
}
129+
125130
const N: usize = 10000;
126131

127132
// Build a module with a function that uses a very large amount of stack space,

tests/disas.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ use wasmtime::{Engine, OptLevel, Strategy};
5454
use wasmtime_cli_flags::CommonOptions;
5555

5656
fn main() -> Result<()> {
57-
if cfg!(miri) {
57+
if cfg!(miri) || cfg!(asan) {
5858
return Ok(());
5959
}
6060

tests/wast.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ fn main() {
4848
];
4949
compilers.retain(|c| c.supports_host());
5050

51+
// Only test one compiler in ASAN since we're mostly interested in testing
52+
// runtime code, not compiler-generated code.
53+
if cfg!(asan) {
54+
compilers.truncate(1);
55+
}
56+
5157
// Run each wast test in a few interesting configuration combinations, but
5258
// leave the full combinatorial matrix and such to fuzz testing which
5359
// configures many more settings than those configured here.
@@ -70,6 +76,12 @@ fn main() {
7076
);
7177
}
7278

79+
// Don't do extra tests in ASAN as it takes awhile and is unlikely to
80+
// reap much benefit.
81+
if cfg!(asan) {
82+
continue;
83+
}
84+
7385
let compiler = compilers[0];
7486

7587
// Run this test with the pooling allocator under the default compiler.

0 commit comments

Comments
 (0)