Skip to content

Commit 714911b

Browse files
committed
Bound Android E2E diagnostics
1 parent 13d130d commit 714911b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflow-scripts/maestro-android.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ node maestro-android.js <path to app> <app_id> <maestro_flow> <flavor> <working_
2626

2727
const DEFAULT_STATE_PATH = '/tmp/maestro-android-state/results.json';
2828
const MAESTRO_LOG_DIRECTORY = '/tmp/MaestroLogs';
29+
const DIAGNOSTIC_COMMAND_TIMEOUT = 15000;
2930
const STATE_VERSION = 1;
3031

3132
function collectFlows(flowPath) {
@@ -102,7 +103,7 @@ function captureFailureArtifacts(flow) {
102103
const screenshot = childProcess.execFileSync(
103104
'adb',
104105
['exec-out', 'screencap', '-p'],
105-
{maxBuffer: 20 * 1024 * 1024},
106+
{maxBuffer: 20 * 1024 * 1024, timeout: DIAGNOSTIC_COMMAND_TIMEOUT},
106107
);
107108
fs.writeFileSync(
108109
path.join(MAESTRO_LOG_DIRECTORY, `${artifactName}-failure.png`),
@@ -116,12 +117,12 @@ function captureFailureArtifacts(flow) {
116117
childProcess.execFileSync(
117118
'adb',
118119
['shell', 'uiautomator', 'dump', '/sdcard/window.xml'],
119-
{stdio: 'ignore'},
120+
{stdio: 'ignore', timeout: DIAGNOSTIC_COMMAND_TIMEOUT},
120121
);
121122
const hierarchy = childProcess.execFileSync(
122123
'adb',
123124
['exec-out', 'cat', '/sdcard/window.xml'],
124-
{maxBuffer: 20 * 1024 * 1024},
125+
{maxBuffer: 20 * 1024 * 1024, timeout: DIAGNOSTIC_COMMAND_TIMEOUT},
125126
);
126127
fs.writeFileSync(
127128
path.join(MAESTRO_LOG_DIRECTORY, `${artifactName}-failure.xml`),
@@ -135,7 +136,7 @@ function captureFailureArtifacts(flow) {
135136
const logcat = childProcess.execFileSync(
136137
'adb',
137138
['logcat', '-d', '-v', 'threadtime'],
138-
{maxBuffer: 50 * 1024 * 1024},
139+
{maxBuffer: 50 * 1024 * 1024, timeout: DIAGNOSTIC_COMMAND_TIMEOUT},
139140
);
140141
fs.writeFileSync(
141142
path.join(MAESTRO_LOG_DIRECTORY, `${artifactName}-logcat.txt`),

0 commit comments

Comments
 (0)