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

Function p2_cli_serve_respect_pooling_options

tests/all/cli_tests.rs:1857–1878  ·  view source on GitHub ↗

TODO: printing stderr in the child and killing the child at the end of this test race so the stderr may be present or not. Need to implement a more graceful shutdown routine for `wasmtime serve`.

()

Source from the content-addressed store, hash-verified

1855 // to implement a more graceful shutdown routine for `wasmtime
1856 // serve`.
1857 async fn p2_cli_serve_respect_pooling_options() -> Result<()> {
1858 let server = WasmtimeServe::new(P2_CLI_SERVE_ECHO_ENV_COMPONENT, |cmd| {
1859 cmd.arg("-Opooling-total-memories=0").arg("-Scli");
1860 })?;
1861
1862 let result = server
1863 .send_request(
1864 hyper::Request::builder()
1865 .uri("http://localhost/")
1866 .header("env", "FOO")
1867 .body(String::new())
1868 .context("failed to make request")?,
1869 )
1870 .await;
1871 assert!(result.is_err());
1872 let (_, stderr) = server.finish()?;
1873 assert!(
1874 stderr.contains("maximum concurrent memory limit of 0 reached"),
1875 "bad stderr: {stderr}",
1876 );
1877 Ok(())
1878 }
1879
1880 #[test]
1881 fn p2_cli_large_env() -> Result<()> {

Callers

nothing calls this directly

Calls 9

OkFunction · 0.85
bodyMethod · 0.80
newFunction · 0.50
builderFunction · 0.50
argMethod · 0.45
send_requestMethod · 0.45
contextMethod · 0.45
headerMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected