From 4006f2730e566c2a4c2bbbbba406f888c401e094 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Wed, 9 Oct 2024 16:39:20 -0700 Subject: [PATCH] For --time'd failed gn_run_binary.py runs repeat failed command (#910) This is to help troubleshoot https://github.com/flutter/flutter/issues/154437 theory being that gen_snapshot binary might be in transient broken state that copying was not able to capture. BUG=https://github.com/flutter/flutter/issues/154437 --- build/gn_run_binary.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build/gn_run_binary.py b/build/gn_run_binary.py index ac88405afe..d6c3076bcd 100644 --- a/build/gn_run_binary.py +++ b/build/gn_run_binary.py @@ -36,4 +36,15 @@ print("Command failed: " + ' '.join(args)) print("exitCode: " + str(ex.returncode)) print(ex.output.decode('utf-8', errors='replace')) + + # For --time'd executions do another control run to confirm failures. + # This is to help troubleshoot https://github.com/flutter/flutter/issues/154437. + if sys.argv[1] == "--time": + try: + subprocess.check_output(args, stderr=subprocess.STDOUT) + except subprocess.CalledProcessError as ex: + print("2nd coming Command failed: " + ' '.join(args)) + print("2nd coming exitCode: " + str(ex.returncode)) + print(ex.output.decode('utf-8', errors='replace')) + sys.exit(ex.returncode)