From 19dbf994dcd085713b5ad44bf8911d7b795bdd8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AE=80=E9=9D=99=E5=87=A1?= <30424139+wtto00@users.noreply.github.com> Date: Sun, 17 Sep 2023 22:37:29 +0800 Subject: [PATCH] chore: timeout to download sdk --- spec/afterStart.test.ts | 2 +- src/index.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/afterStart.test.ts b/spec/afterStart.test.ts index 616e802..bf223ba 100644 --- a/spec/afterStart.test.ts +++ b/spec/afterStart.test.ts @@ -21,7 +21,7 @@ beforeAll(async () => { if (emulatorId) { await android.ensureReady(emulatorId); } -}, 300000); +}, 1200000); afterAll(async () => { await android.waitForStop(emulatorId); diff --git a/src/index.ts b/src/index.ts index ec1f339..324338e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -227,7 +227,8 @@ class Android { */ async createAVD(options: CreateAVDOptions) { if (options.package) { - await this.sdkmanager(`--install ${options.package}`, 180000); + // Downloading the SDK takes a lot of time, so it's best to download it in advance. + await this.sdkmanager(`--install ${options.package}`, 600000); } const cmdParams = Object.keys(options).reduce((prev, curr) => { const val = options[curr as keyof CreateAVDOptions];