Skip to content

Commit

Permalink
Crash is not thrown by ADB and only recorded in logcat, which not eve…
Browse files Browse the repository at this point in the history
…ntually result in test failure, and video cannot be stored correctly (#568)
  • Loading branch information
olivershen-wow committed Aug 9, 2023
1 parent ed4f5d4 commit 79aecb7
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ protected void run(TestRunDevice testRunDevice, TestTask testTask, TestRun testR
performanceTestManagementService.testStarted(TEST_RUN_NAME);
long checkTime = runMonkeyTestOnce(testRun, logger, testTask.getInstrumentationArgs(),
testTask.getMaxStepCount());

releaseResource(testTask, testRunDevice, testRun);
if (checkTime > 0) {
String crashStack = testRun.getCrashStack();
if (crashStack != null && !"".equals(crashStack)) {
Expand All @@ -83,7 +85,7 @@ protected void run(TestRunDevice testRunDevice, TestTask testTask, TestRun testR
}
}
performanceTestManagementService.testRunFinished();
testRunEnded(testTask, testRunDevice, testRun);
testRunEnded(testRun);

/** set paths */
String absoluteReportPath = testRun.getResultFolder().getAbsolutePath();
Expand Down Expand Up @@ -180,14 +182,17 @@ public long runMonkeyTestOnce(TestRun testRun, Logger logger,
return checkTime;
}

public void testRunEnded(TestTask testTask, TestRunDevice testRunDevice, TestRun testRun) {
testRun.addNewTimeTag("testRunEnded", System.currentTimeMillis() - recordingStartTimeMillis);
testRun.onTestEnded();
public void releaseResource(TestTask testTask, TestRunDevice testRunDevice, TestRun testRun) {
testRunDeviceOrchestrator.setRunningTestName(testRunDevice, null);
testRunDeviceOrchestrator.stopGitEncoder(testRunDevice, agentManagementService.getScreenshotDir(), logger);
if (!testTask.isDisableRecording()) {
testRunDeviceOrchestrator.stopScreenRecorder(testRunDevice, testRun.getResultFolder(), logger);
}
testRunDeviceOrchestrator.stopLogCollector(testRunDevice);
}

public void testRunEnded(TestRun testRun) {
testRun.addNewTimeTag("testRunEnded", System.currentTimeMillis() - recordingStartTimeMillis);
testRun.onTestEnded();
}
}

0 comments on commit 79aecb7

Please sign in to comment.