diff options
Diffstat (limited to 'cli/bench')
-rw-r--r-- | cli/bench/deno_http_native.js | 6 | ||||
-rw-r--r-- | cli/bench/main.rs | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/cli/bench/deno_http_native.js b/cli/bench/deno_http_native.js index 4c06bd7c1..2b576255e 100644 --- a/cli/bench/deno_http_native.js +++ b/cli/bench/deno_http_native.js @@ -12,7 +12,11 @@ for await (const conn of listener) { (async () => { const requests = Deno.serveHttp(conn); for await (const { respondWith } of requests) { - respondWith(new Response(body)); + try { + respondWith(new Response(body)); + } catch { + // Ignore. + } } })(); } diff --git a/cli/bench/main.rs b/cli/bench/main.rs index d19731faa..c7a6a714e 100644 --- a/cli/bench/main.rs +++ b/cli/bench/main.rs @@ -340,10 +340,10 @@ fn run_strace_benchmarks( let mut thread_count = HashMap::<String, u64>::new(); let mut syscall_count = HashMap::<String, u64>::new(); - for (name, args, _) in EXEC_TIME_BENCHMARKS { + for (name, args, expected_exit_code) in EXEC_TIME_BENCHMARKS { let mut file = tempfile::NamedTempFile::new()?; - Command::new("strace") + let exit_status = Command::new("strace") .args(&[ "-c", "-f", @@ -352,9 +352,11 @@ fn run_strace_benchmarks( deno_exe.to_str().unwrap(), ]) .args(args.iter()) - .stdout(Stdio::inherit()) + .stdout(Stdio::null()) .spawn()? .wait()?; + let expected_exit_code = expected_exit_code.unwrap_or(0); + assert_eq!(exit_status.code(), Some(expected_exit_code)); let mut output = String::new(); file.as_file_mut().read_to_string(&mut output)?; |