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

Function p2_cli_serve_only_one_process_allowed

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

Source from the content-addressed store, hash-verified

1903
1904 #[tokio::test]
1905 async fn p2_cli_serve_only_one_process_allowed() -> Result<()> {
1906 let wasm = P2_CLI_SERVE_ECHO_ENV_COMPONENT;
1907 let server = WasmtimeServe::new(wasm, |cmd| {
1908 cmd.arg("-Scli");
1909 })?;
1910
1911 let err = WasmtimeServe::spawn(
1912 super::get_wasmtime_command()?
1913 .arg("serve")
1914 .arg("-Scli")
1915 .arg(format!("--addr={}", server.addr))
1916 .arg(wasm),
1917 )
1918 .err()
1919 .expect("server spawn should have failed but it succeeded");
1920 drop(server);
1921
1922 let err = format!("{err:?}");
1923 println!("{err}");
1924 assert!(err.contains("os error"));
1925 Ok(())
1926 }
1927
1928 // Technically this test is a little racy. This binds port 0 to acquire a
1929 // random port, issues a single request to this port, but then kills this

Callers

nothing calls this directly

Calls 8

spawnFunction · 0.85
get_wasmtime_commandFunction · 0.85
OkFunction · 0.85
newFunction · 0.50
dropFunction · 0.50
argMethod · 0.45
expectMethod · 0.45
errMethod · 0.45

Tested by

no test coverage detected