New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 621380 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Factory tests hang instead of fail when unexpected exception.

Project Member Reported by shunhsingou@chromium.org, Jun 19 2016

Issue description

When unhandled exception seen in the factory test, it usually means there are some problems of the device or in the test code, and we need to mark the test as fail. However, we found sometimes tests hang instead of fail when unexpected exception throwed. This also happens when calling ui.fail() explicitly sometimes.

The reason is that crashing of a worker thread does not crash main process in python. So if a test is design with multi-thread and one of the thread runs ui.fail() or sees unexpected exception, the main thread is still alive. The main thread may still wait for the result from the crashed thread and thus hangs forever.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/8617d816d5432bcecb04ae31562db741bc964404

commit 8617d816d5432bcecb04ae31562db741bc964404
Author: Shun-Hsing Ou <shunhsingou@chromium.org>
Date: Sat Jun 18 15:03:46 2016

Add option to interrupt process in StartDaemonThread

Sometimes we need to run a function on a separated thread. However, when
the thread crashes with unexpected expection, which is usuall caused by DUT
problem, the main process keeps alive and may hang forever.  Therefore, in
such case we may want to crash the entire process and log execption.

Add an option in StartDaemonThread to interrupt the process when thread
crashes.

BUG= chromium:621380 
TEST=Apply to camera test and manually tested.

Change-Id: I6819f4c1262300caeb41bd71ee2282a79c17ac8e
Reviewed-on: https://chromium-review.googlesource.com/353921
Commit-Ready: Shun-Hsing Ou <shunhsingou@chromium.org>
Tested-by: Shun-Hsing Ou <shunhsingou@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/8617d816d5432bcecb04ae31562db741bc964404/py/utils/process_utils.py
[modify] https://crrev.com/8617d816d5432bcecb04ae31562db741bc964404/py/test/pytests/camera.py

Project Member

Comment 2 by bugdroid1@chromium.org, Jun 24 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/f7b1d06154dff86b3e5bfc3b2fbc142c1992ac5b

commit f7b1d06154dff86b3e5bfc3b2fbc142c1992ac5b
Author: Shun-Hsing Ou <shunhsingou@chromium.org>
Date: Fri Jun 24 05:45:05 2016

StartDaemonThread: remove additional 'interrupt_on_crash' args

Before passing arguments to thread, we need to remove the additional
args if set.

BUG= chromium:621380 
TEST=Manually

Change-Id: I272497bb9b604e5188716507b88824a9e1bc6b0b
Reviewed-on: https://chromium-review.googlesource.com/355709
Commit-Ready: Shun-Hsing Ou <shunhsingou@chromium.org>
Tested-by: Shun-Hsing Ou <shunhsingou@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/f7b1d06154dff86b3e5bfc3b2fbc142c1992ac5b/py/utils/process_utils.py

Comment 3 by hungte@chromium.org, Aug 11 2016

Hi Earl, do you have anything left for this issue or can we close it?
Status: Verified (was: Untriaged)
This had been fixed.

Sign in to add a comment