I have an Android project that I want to run Instrumentation tests on in a GCP Gitlab-runner. I have virtualization enabled for that runner. I installed Android SDK tools, created a avd based on 'pixel' device, started on emulator using that avd.
My avd create command(where EMULATOR_IMAGE is system-images;android-30;google_apis;x86): echo n | avdmanager --verbose create avd -n Pixel --device "pixel" -k "${EMULATOR_IMAGE}" --abi "x86" -f.
My emulator start command: emulator -avd Pixel -no-window -no-audio -no-boot-anim -dns-server 8.8.8.8 &
After verifying that the emulator is running, I'm giving my gradle command to run Instrumentation tests. I can see message in log: Starting 119 tests on Pixel(AVD) - 11
After a few seconds, I see the below message:
Session terminated, terminating shell... ...terminated.
If I see the report for failed tests, I can see the below error:
com.android.ddmlib.TimeoutException: executeRemoteCommand interrupted with immediate timeout via interruption.
What would be a good way to approach this problem ? How can I verify why the tests are failing. Does giving Google's DNS help the emulator connect to the internet without any issues ? Is there a good way to verify if emulator is connected(I cannot make significant changes to code as I'm in DevOps and not the developer) ?