From 3bdf02e57d81415b82a27e9ce3d603d4aeac0e3e Mon Sep 17 00:00:00 2001 From: Aaron Silverman Date: Mon, 23 Oct 2023 19:19:35 -0600 Subject: [PATCH] ensure emulator ready for tests --- .github/workflows/test.yml | 12 ++++++++++++ Makefile | 2 -- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7d2feac1..8e96e7f3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,4 +46,16 @@ jobs: script: | echo "Emulator started" adb reverse tcp:4001 tcp:4001 + echo "Waiting for emulator to boot" + timeout=300 # 5 minutes + counter=0 + while [[ -z $(adb shell getprop sys.boot_completed | tr -d '\r') ]]; do + if [ $counter -ge $timeout ]; then + echo "Timeout waiting for emulator to boot" + exit 1 + fi + counter=$((counter + 1)) + sleep 1 + done + echo "Emulator shell ready" make test \ No newline at end of file diff --git a/Makefile b/Makefile index 60a19318..d803ccd0 100644 --- a/Makefile +++ b/Makefile @@ -45,8 +45,6 @@ test-data: ## test .PHONY: test test: test-data - # $(INFO)Uninstalling old version of test app(END) - # adb uninstall cloud.eppo.android.test # $(INFO)Running tests(END) ./gradlew runEppoTests