MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / timeout_in_invoke

Function timeout_in_invoke

tests/all/cli_tests.rs:217–236  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

215
216#[test]
217fn timeout_in_invoke() -> Result<()> {
218 let wasm = build_wasm("tests/all/cli_tests/iloop-invoke.wat")?;
219 let output = run_wasmtime_for_output(
220 &[
221 "run",
222 "-Wtimeout=1ms",
223 "-Ccache=n",
224 wasm.path().to_str().unwrap(),
225 ],
226 None,
227 )?;
228 assert!(!output.status.success());
229 assert_eq!(output.stdout, b"");
230 let stderr = String::from_utf8_lossy(&output.stderr);
231 assert!(
232 stderr.contains("wasm trap: interrupt"),
233 "bad stderr: {stderr}"
234 );
235 Ok(())
236}
237
238// Exit with a valid non-zero exit code, snapshot0 edition.
239#[test]

Callers

nothing calls this directly

Calls 6

run_wasmtime_for_outputFunction · 0.85
OkFunction · 0.85
to_strMethod · 0.80
build_wasmFunction · 0.70
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected