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

Issue 914640 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 7
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Make Smart Dim Unit test implementation multi-threaded

Project Member Reported by pmalani@chromium.org, Dec 13

Issue description

UserActivityManager uses a FakeSmartDim model which is not multi-threaded.

This model needs to be made multi-threaded to better represent real work usage scenarios.
 
Cc: claudiomagni@chromium.org martis@chromium.org napper@chromium.org
Components: UI>ML>Service
Status: Available (was: Untriaged)
Useful discussion thread with scheduler-dev:
https://groups.google.com/a/chromium.org/forum/?utm_medium=email&utm_source=footer#!msg/scheduler-dev/Ztv3G1PbvT0/P9cIS2owCQAJ

Status: Assigned (was: Available)
Project Member

Comment 3 by bugdroid1@chromium.org, Jan 2

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a0c1844467ad9e40e0a7ab242c8a09beeb4e998f

commit a0c1844467ad9e40e0a7ab242c8a09beeb4e998f
Author: Prashant Malani <pmalani@chromium.org>
Date: Wed Jan 02 22:12:35 2019

Add RenderViewHostTestHarness ctor for thread bundle

Add a new constructor for RenderViewHostTestHarness (and its derived
class ChromeRenderViewHostTestHarness) to include
ScopedTaskEnvironment parameters. This will allow the test harness
classes to use the ScopedTaskEnvironment's task runner for mock time
task runners, instead of instantiating a separate
TestMockTimeTaskRunner.

This CL also modifies the UserActivityManagerTest unit tests to leverage
this in-built ScopedTaskEnvironment and remove the mock time task
runner, and also makes the FakeSmartDimModel implementation utilize the
task runner for posting tasks, to better mimick real-world behaviour.

Bug: 893425,  914640 ,  917580 
Test: - Builds and boots, inference calls checked via logs on nocturne
      - All related unit tests still pass.

Change-Id: I552ae98f6b2bce88845d17648303001a3c644788
Reviewed-on: https://chromium-review.googlesource.com/c/1389963
Commit-Queue: Prashant Malani <pmalani@chromium.org>
Reviewed-by: Jia Meng <jiameng@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619512}
[modify] https://crrev.com/a0c1844467ad9e40e0a7ab242c8a09beeb4e998f/chrome/browser/chromeos/power/ml/adaptive_screen_brightness_manager_unittest.cc
[modify] https://crrev.com/a0c1844467ad9e40e0a7ab242c8a09beeb4e998f/chrome/browser/chromeos/power/ml/fake_boot_clock.cc
[modify] https://crrev.com/a0c1844467ad9e40e0a7ab242c8a09beeb4e998f/chrome/browser/chromeos/power/ml/fake_boot_clock.h
[modify] https://crrev.com/a0c1844467ad9e40e0a7ab242c8a09beeb4e998f/chrome/browser/chromeos/power/ml/user_activity_manager_unittest.cc
[modify] https://crrev.com/a0c1844467ad9e40e0a7ab242c8a09beeb4e998f/chrome/test/base/chrome_render_view_host_test_harness.cc
[modify] https://crrev.com/a0c1844467ad9e40e0a7ab242c8a09beeb4e998f/chrome/test/base/chrome_render_view_host_test_harness.h
[modify] https://crrev.com/a0c1844467ad9e40e0a7ab242c8a09beeb4e998f/content/public/test/test_renderer_host.cc
[modify] https://crrev.com/a0c1844467ad9e40e0a7ab242c8a09beeb4e998f/content/public/test/test_renderer_host.h

Project Member

Comment 4 by bugdroid1@chromium.org, Jan 4

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c29a991d2542140a8e8a30e894832172c8042596

commit c29a991d2542140a8e8a30e894832172c8042596
Author: Prashant Malani <pmalani@chromium.org>
Date: Fri Jan 04 06:28:26 2019

[Power: ML]: Add UMA logging for ML service Smart Dim calls

Add UMA logging of time taken to complete ML service requests,
as well as the time spent before a pending request is cancelled.
Also update the existing Smart Dim unit tests to verify that the logging
works.

Bug: 893425,  914640 
Test: - Builds and boots, inference calls checked via logs on nocturne
      - All related unit tests still pass.

Change-Id: I542af752a0133939c65eaa435ed3f5be907140db
Reviewed-on: https://chromium-review.googlesource.com/c/1393670
Reviewed-by: Jia Meng <jiameng@chromium.org>
Commit-Queue: Prashant Malani <pmalani@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619892}
[modify] https://crrev.com/c29a991d2542140a8e8a30e894832172c8042596/chrome/browser/chromeos/power/ml/user_activity_manager.cc
[modify] https://crrev.com/c29a991d2542140a8e8a30e894832172c8042596/chrome/browser/chromeos/power/ml/user_activity_manager.h
[modify] https://crrev.com/c29a991d2542140a8e8a30e894832172c8042596/chrome/browser/chromeos/power/ml/user_activity_manager_unittest.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Jan 7

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1e8907ef95230b2f2c0aa771e4a9f3754339c60f

commit 1e8907ef95230b2f2c0aa771e4a9f3754339c60f
Author: Prashant Malani <pmalani@chromium.org>
Date: Mon Jan 07 06:21:04 2019

[Power: ML]: Add unit tests to check canceled Smart Dim request

This CL adds tests for a couple of scenarios where previously requested
Smart Dim decisions are canceled, and verifies that the events are
logged to UMA correctly.

Bug: 893425,  914640 
Test: - Builds and boots, inference calls checked via logs on nocturne.
      - All related unit tests still pass.

Change-Id: Ia412209360ea8f65b0087a7c87042a6cb243d7d5
Reviewed-on: https://chromium-review.googlesource.com/c/1395962
Reviewed-by: Jia Meng <jiameng@chromium.org>
Commit-Queue: Prashant Malani <pmalani@chromium.org>
Cr-Commit-Position: refs/heads/master@{#620260}
[modify] https://crrev.com/1e8907ef95230b2f2c0aa771e4a9f3754339c60f/chrome/browser/chromeos/power/ml/user_activity_manager.cc
[modify] https://crrev.com/1e8907ef95230b2f2c0aa771e4a9f3754339c60f/chrome/browser/chromeos/power/ml/user_activity_manager_unittest.cc

Status: Fixed (was: Assigned)
Marking this as fixed for now. Let's open new bugs if there are issues that we notice.

Sign in to add a comment