From 3c5fb72a1eb7860e7351bee0b552cc804a05b5fb Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Tue, 13 Oct 2020 20:19:48 -0700 Subject: [PATCH 1/4] Collect logs in the background. --- testing/fuchsia/run_tests.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/testing/fuchsia/run_tests.sh b/testing/fuchsia/run_tests.sh index f39233dec6642..c099b3811813e 100755 --- a/testing/fuchsia/run_tests.sh +++ b/testing/fuchsia/run_tests.sh @@ -45,18 +45,20 @@ fuchsia_ctl() { } reboot() { - fuchsia_ctl ssh \ - --timeout-seconds $ssh_timeout_seconds \ - --identity-file $pkey \ - -c "log_listener --dump_logs yes --file /tmp/log.txt" + #fuchsia_ctl ssh \ + # --timeout-seconds $ssh_timeout_seconds \ + # --identity-file $pkey \ + # -c "log_listener --dump_logs yes --file /tmp/log.txt" # As we are not using recipes we don't have a way to know the location # to upload the log to isolated. We are saving the log to a file to avoid dart # hanging when running the process and then just using printing the content to # the console. - fuchsia_ctl ssh \ - --timeout-seconds $ssh_timeout_seconds \ - --identity-file $pkey \ - -c "cat /tmp/log.txt" + kill -9 $PID + cat /tmp/log.txt + #fuchsia_ctl ssh \ + # --timeout-seconds $ssh_timeout_seconds \ + # --identity-file $pkey \ + # -c "cat /tmp/log.txt" echo "$(date) START:REBOOT ----------------------------------------" @@ -82,6 +84,9 @@ for i in {1..10}; do --identity-file $pkey \ -c "echo up" && break || sleep 15; done +rm -rf /tmp/fuchsia_log.txt +fuchsia_ctl ssh --timeout-seconds 1800 --identity-file $pkey -c "log_listener" > /tmp/log.txt 2>&1 & +PID=$! echo "$(date) END:WAIT_DEVICE_READY ---------------------------------" echo "$(date) START:EXTRACT_PACKAGES -------------------------------" From 7a616d7a55fefee7feec6ef64a49192306ec2bd3 Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Wed, 14 Oct 2020 22:55:49 -0700 Subject: [PATCH 2/4] Use fuchsia_ctl log_file option. --- testing/fuchsia/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/fuchsia/run_tests.sh b/testing/fuchsia/run_tests.sh index c099b3811813e..1d0dc96fe8f22 100755 --- a/testing/fuchsia/run_tests.sh +++ b/testing/fuchsia/run_tests.sh @@ -85,7 +85,7 @@ for i in {1..10}; do -c "echo up" && break || sleep 15; done rm -rf /tmp/fuchsia_log.txt -fuchsia_ctl ssh --timeout-seconds 1800 --identity-file $pkey -c "log_listener" > /tmp/log.txt 2>&1 & +fuchsia_ctl ssh --timeout-seconds 1800 --identity-file $pkey -c "log_listener" --log-file /tmp/log.txt & PID=$! echo "$(date) END:WAIT_DEVICE_READY ---------------------------------" From b97e23dd4c08947df3a5353c3309cf4c7a1b4801 Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Thu, 15 Oct 2020 09:26:25 -0700 Subject: [PATCH 3/4] Delete the correct file. --- testing/fuchsia/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/fuchsia/run_tests.sh b/testing/fuchsia/run_tests.sh index 1d0dc96fe8f22..3b026577bc657 100755 --- a/testing/fuchsia/run_tests.sh +++ b/testing/fuchsia/run_tests.sh @@ -84,7 +84,7 @@ for i in {1..10}; do --identity-file $pkey \ -c "echo up" && break || sleep 15; done -rm -rf /tmp/fuchsia_log.txt +rm -rf /tmp/log.txt fuchsia_ctl ssh --timeout-seconds 1800 --identity-file $pkey -c "log_listener" --log-file /tmp/log.txt & PID=$! echo "$(date) END:WAIT_DEVICE_READY ---------------------------------" From 5c202c5015859a13bc890c3e68735f1c53460b56 Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Fri, 16 Oct 2020 17:07:20 -0700 Subject: [PATCH 4/4] Remove commented code. --- testing/fuchsia/run_tests.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/testing/fuchsia/run_tests.sh b/testing/fuchsia/run_tests.sh index 3b026577bc657..28fba45e1f8bf 100755 --- a/testing/fuchsia/run_tests.sh +++ b/testing/fuchsia/run_tests.sh @@ -45,22 +45,12 @@ fuchsia_ctl() { } reboot() { - #fuchsia_ctl ssh \ - # --timeout-seconds $ssh_timeout_seconds \ - # --identity-file $pkey \ - # -c "log_listener --dump_logs yes --file /tmp/log.txt" # As we are not using recipes we don't have a way to know the location # to upload the log to isolated. We are saving the log to a file to avoid dart # hanging when running the process and then just using printing the content to # the console. kill -9 $PID cat /tmp/log.txt - #fuchsia_ctl ssh \ - # --timeout-seconds $ssh_timeout_seconds \ - # --identity-file $pkey \ - # -c "cat /tmp/log.txt" - - echo "$(date) START:REBOOT ----------------------------------------" # note: this will set an exit code of 255, which we can ignore. fuchsia_ctl ssh \