summaryrefslogtreecommitdiff
path: root/test/default_run.py
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2022-11-16 15:02:33 +0000
committer David Srbecky <dsrbecky@google.com> 2022-11-16 15:56:04 +0000
commitb5e970355b001bd0fbe05acdf92d7e584daeb3cb (patch)
treea7a44806786acacefd1b2c6b35e633eb7c46f8c9 /test/default_run.py
parent1a9ed06f4ce037d55fcd8fb320530890cb5bb1ee (diff)
Run test run: Filter interleaved log lines.
Different threads can print to stderr, causing interleaved output. Test: art/test.py -b -r --host Change-Id: Iad9b96409e7c283569866bae67235d69f9a33ad3
Diffstat (limited to 'test/default_run.py')
-rwxr-xr-xtest/default_run.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/default_run.py b/test/default_run.py
index e6c9f51694..b6d2451d02 100755
--- a/test/default_run.py
+++ b/test/default_run.py
@@ -1385,14 +1385,17 @@ def default_run(ctx, args, **kwargs):
env,
expected_exit_code=args.expected_exit_code)
+ # Remove unwanted log messages from stderr before diffing with the expected output.
+ # NB: The unwanted log line can be interleaved in the middle of wanted stderr printf.
+ # In particular, unhandled exception is printed using several unterminated printfs.
ALL_LOG_TAGS = ["V", "D", "I", "W", "E", "F", "S"]
skip_tag_set = "|".join(ALL_LOG_TAGS[:ALL_LOG_TAGS.index(args.diff_min_log_tag.upper())])
- skip_reg_exp = f'^[[:alnum:]]+ ({skip_tag_set}) #-# #:#:# '.replace('#', '[0-9]+')
- run(fr"sed -i -E '/{skip_reg_exp}/d' '{args.stderr_file}'")
+ skip_reg_exp = fr'[[:alnum:]]+ ({skip_tag_set}) #-# #:#:# [^\n]*\n'.replace('#', '[0-9]+')
+ run(fr"sed -i -z -E 's/{skip_reg_exp}//g' '{args.stderr_file}'")
if not HAVE_IMAGE:
message = "(Unable to open file|Could not create image space)"
run(fr"sed -i -E '/^dalvikvm(|32|64) E .* {message}/d' '{args.stderr_file}'")
- if "D" in skip_tag_set:
+ if ANDROID_LOG_TAGS != "*:i" and "D" in skip_tag_set:
run(fr"sed -i -E '/^(Time zone|I18n) APEX ICU file found/d' '{args.stderr_file}'")
else:
# With a thread dump that uses gdb if a timeout.