Skip to content

Commit 71507f7

Browse files
authored
fix(genycloud): reallocate unresponsive devices (#4743)
1 parent 1ae4467 commit 71507f7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

detox/src/devices/allocation/drivers/android/genycloud/GenyAllocDriver.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ class GenyAllocDriver {
102102
* @return {Promise<void>}
103103
*/
104104
async free(cookie, options = {}) {
105+
try {
106+
if (!options.shutdown) {
107+
await Timer.run(10000, 'waiting for device to respond', async () => {
108+
await this._adb.shell(cookie.adbName, 'echo ok');
109+
});
110+
}
111+
} catch {
112+
options.shutdown = true;
113+
}
114+
105115
// Known issue: cookie won't have a proper 'instance' field due to (de)serialization
106116
if (options.shutdown) {
107117
this._genyRegistry.removeInstance(cookie.id);

0 commit comments

Comments
 (0)