Index: tools/telemetry/telemetry/core/platform/power_monitor/msr_power_monitor_unittest.py |
diff --git a/tools/telemetry/telemetry/core/platform/power_monitor/msr_power_monitor_unittest.py b/tools/telemetry/telemetry/core/platform/power_monitor/msr_power_monitor_unittest.py |
index 6a28509f4dca89fe360654046b1f72a9829dec54..f3408a759e2e6d767618425d1c42689defeaf09c 100644 |
--- a/tools/telemetry/telemetry/core/platform/power_monitor/msr_power_monitor_unittest.py |
+++ b/tools/telemetry/telemetry/core/platform/power_monitor/msr_power_monitor_unittest.py |
@@ -3,6 +3,7 @@ |
# found in the LICENSE file. |
import logging |
+import time |
import unittest |
from telemetry import decorators |
@@ -12,12 +13,7 @@ from telemetry.core.platform.power_monitor import msr_power_monitor |
class MsrPowerMonitorTest(unittest.TestCase): |
@decorators.Enabled('win') |
- def testFindOrInstallWinRing0(self): |
- self.assertTrue(msr_power_monitor.WinRing0Path()) |
- |
- @decorators.Enabled('win') |
- def testMsrRunsWithoutErrors(self): |
- # Very basic test, doesn't validate any output data. |
+ def testMsrRuns(self): |
platform_backend = win_platform_backend.WinPlatformBackend() |
power_monitor = msr_power_monitor.MsrPowerMonitor(platform_backend) |
if not power_monitor.CanMonitorPower(): |
@@ -25,7 +21,9 @@ class MsrPowerMonitorTest(unittest.TestCase): |
return |
power_monitor.StartMonitoringPower(None) |
+ time.sleep(0.01) |
statistics = power_monitor.StopMonitoringPower() |
self.assertEqual(statistics['identifier'], 'msr') |
self.assertIn('energy_consumption_mwh', statistics) |
+ self.assertGreater(statistics['energy_consumption_mwh'], 0) |