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`.
()
| 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<()> { |