summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcos Casagrande <marcoscvp90@gmail.com>2022-10-16 21:37:42 +0200
committerGitHub <noreply@github.com>2022-10-16 21:37:42 +0200
commit9fe508dfb955ff49e7e87aa208717a1cbf525437 (patch)
tree458ead4cd39be3abff8ff2f271242ada793e235a
parentcf1be5e76fc8d62357f1f4a51e610bd4f07a7927 (diff)
fix(cli/bench): skip strace table border (#16310)
It crashes due to the table border output from `strace`, ``` % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- # this is skipped correctly 61.27 6.012053 678 8860 637 futex 0.00 0.000000 0 4 geteuid ------ ----------- ----------- --------- --------- ---------------- # this causes the crash 100.00 11.732230 25552 1205 total ``` It's flaky because that line is not always skipped from the output, for some reason that I've yet to find out.
-rw-r--r--test_util/src/lib.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs
index 363fe5d3f..b5d509945 100644
--- a/test_util/src/lib.rs
+++ b/test_util/src/lib.rs
@@ -2198,9 +2198,12 @@ pub fn parse_strace_output(output: &str) -> HashMap<String, StraceOutput> {
// Filter out non-relevant lines. See the error log at
// https://github.com/denoland/deno/pull/3715/checks?check_run_id=397365887
// This is checked in testdata/strace_summary2.out
- let mut lines = output
- .lines()
- .filter(|line| !line.is_empty() && !line.contains("detached ..."));
+ let mut lines = output.lines().filter(|line| {
+ !line.is_empty()
+ && !line.contains("detached ...")
+ && !line.contains("unfinished ...")
+ && !line.contains("????")
+ });
let count = lines.clone().count();
if count < 4 {
@@ -2215,7 +2218,6 @@ pub fn parse_strace_output(output: &str) -> HashMap<String, StraceOutput> {
let syscall_fields = line.split_whitespace().collect::<Vec<_>>();
let len = syscall_fields.len();
let syscall_name = syscall_fields.last().unwrap();
-
if (5..=6).contains(&len) {
summary.insert(
syscall_name.to_string(),