Unverified Commit 09072627 authored by Gary Qian's avatar Gary Qian Committed by GitHub

Track timeout from app run start in deferred components integration test (#93307)

parent 2a17ce4e
...@@ -19,7 +19,6 @@ adb_path=$2 ...@@ -19,7 +19,6 @@ adb_path=$2
# Store the time to prevent capturing logs from previous runs. # Store the time to prevent capturing logs from previous runs.
script_start_time=$($adb_path shell 'date +"%m-%d %H:%M:%S.0"') script_start_time=$($adb_path shell 'date +"%m-%d %H:%M:%S.0"')
script_start_time_seconds=$(date +%s)
$adb_path uninstall "io.flutter.integration.deferred_components_test" $adb_path uninstall "io.flutter.integration.deferred_components_test"
...@@ -35,6 +34,7 @@ $adb_path shell " ...@@ -35,6 +34,7 @@ $adb_path shell "
am start -n io.flutter.integration.deferred_components_test/.MainActivity am start -n io.flutter.integration.deferred_components_test/.MainActivity
exit exit
" "
run_start_time_seconds=$(date +%s)
while read LOGLINE while read LOGLINE
do do
if [[ "${LOGLINE}" == *"Running deferred code"* ]]; then if [[ "${LOGLINE}" == *"Running deferred code"* ]]; then
...@@ -45,8 +45,8 @@ do ...@@ -45,8 +45,8 @@ do
fi fi
# Timeout if expected log not found # Timeout if expected log not found
current_time=$(date +%s) current_time=$(date +%s)
if [[ $((current_time - script_start_time_seconds)) -ge 150 ]]; then if [[ $((current_time - run_start_time_seconds)) -ge 150 ]]; then
echo "Failure: Deferred component did not load." echo "Failure: Timed out, deferred component did not load."
pkill -P $$ pkill -P $$
exit 1 exit 1
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment