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

Issue 756182 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Sep 7
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

factory: Clean up: threading.Thread, StartDaemonThread, and RunInBackground

Project Member Reported by hungte@chromium.org, Aug 16 2017

Issue description

Currently in pytests we have programs doing background thread in 3 different ways:

1. threading.Thread (should be buggy?)
2. process_utils.StartDaemonThread
3. ui.RunInBackground

Most pytests should have been replaced by RunInBackground in the clean up or //chromium-review.googlesource.com/431331, but there are still tests left.

I think we should add comments if a test can't use RunInBackground; otherwise, fix them.

Tests doing threading.Thread:
- badblocks
- update_firmware
- tpm_diagnosis
- finalize (?)
- touchscreen_calibration (?)
- charger
- usb.py (should we change RunInBackground to also take a Thread object?)

Tests doing StartDaemonThread for ui thing:
- flush_testlog
- button
- battery_cycle
- brightness
- wait_external
- webrtc_camera
- display_idle
- tablet_rotation
- network_setup
- plankton_cc_flip_check
- scan
- webgl_aquiarium
- light_sensor
 
Project Member

Comment 1 by bugdroid1@chromium.org, Sep 29 2017

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

commit 2bdd1aaf604d796f7772d83897952dd9d9c298d4
Author: Peter Shih <pihsun@chromium.org>
Date: Fri Sep 29 13:29:12 2017

pytest: Make better document for tablet_rotation.

Make better document for tablet_rotation.

Also change the custom StartDaemonThread call to RunInBackground, and
fix some issue about accelerometer API change.

BUG= chromium:737920 , chromium:756182 
TEST=make test
TEST=manually on DUT.

Change-Id: Ie113e99e7c3d7a51fbee0b9d98c42ba07a51b398
Reviewed-on: https://chromium-review.googlesource.com/691500
Commit-Ready: Pi-Hsun Shih <pihsun@chromium.org>
Tested-by: Pi-Hsun Shih <pihsun@chromium.org>
Reviewed-by: Ting Shen <phoenixshen@chromium.org>

[modify] https://crrev.com/2bdd1aaf604d796f7772d83897952dd9d9c298d4/py/test/pytests/tablet_rotation.py

Project Member

Comment 2 by bugdroid1@chromium.org, Sep 30 2017

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

commit cf005ed89e0b64c4ccc99e71bc3c6ba2bebbe553
Author: Peter Shih <pihsun@chromium.org>
Date: Sat Sep 30 06:25:39 2017

pytests: Cleanup to use test_ui.RunInBackground.

Use test_ui.RunInBackground instead of manual invoking thread, to
simplify the code.

BUG= chromium:756182 
TEST=make test

Change-Id: I68006c7378e9a676f02799b8bf07739f471d957b
Reviewed-on: https://chromium-review.googlesource.com/691400
Commit-Ready: Pi-Hsun Shih <pihsun@chromium.org>
Tested-by: Pi-Hsun Shih <pihsun@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/cf005ed89e0b64c4ccc99e71bc3c6ba2bebbe553/py/test/pytests/network_setup/network_setup.py
[modify] https://crrev.com/cf005ed89e0b64c4ccc99e71bc3c6ba2bebbe553/py/test/pytests/battery_cycle.py
[modify] https://crrev.com/cf005ed89e0b64c4ccc99e71bc3c6ba2bebbe553/py/test/pytests/scan/scan.py
[modify] https://crrev.com/cf005ed89e0b64c4ccc99e71bc3c6ba2bebbe553/py/test/pytests/charger.py
[modify] https://crrev.com/cf005ed89e0b64c4ccc99e71bc3c6ba2bebbe553/py/test/pytests/wait_external_test.py
[modify] https://crrev.com/cf005ed89e0b64c4ccc99e71bc3c6ba2bebbe553/py/test/test_ui.py
[modify] https://crrev.com/cf005ed89e0b64c4ccc99e71bc3c6ba2bebbe553/py/test/pytests/update_firmware.py
[modify] https://crrev.com/cf005ed89e0b64c4ccc99e71bc3c6ba2bebbe553/py/test/pytests/brightness/brightness.py
[modify] https://crrev.com/cf005ed89e0b64c4ccc99e71bc3c6ba2bebbe553/py/test/pytests/usb.py
[modify] https://crrev.com/cf005ed89e0b64c4ccc99e71bc3c6ba2bebbe553/py/test/pytests/bad_blocks.py
[modify] https://crrev.com/cf005ed89e0b64c4ccc99e71bc3c6ba2bebbe553/py/test/pytests/tpm_diagnosis.py
[modify] https://crrev.com/cf005ed89e0b64c4ccc99e71bc3c6ba2bebbe553/py/test/pytests/button.py

Status: Assigned (was: Untriaged)
Status: Fixed (was: Assigned)

Sign in to add a comment