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

Issue 725287 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

ash_unittests PointerMetricsRecorderTest is flaky

Project Member Reported by jamescook@chromium.org, May 22 2017

Issue description

When running tests locally (in bulk, not individually) it always fails the first time, then succeeds on retry. This slows down the bulk run.

Run:
testing/xvfb.py out/Default/ash_unittests

These will fail, then retry:
[1457/1459] PointerMetricsRecorderTest.DownEventPerInput (181 ms)
[1458/1459] PointerMetricsRecorderTest.DownEventPerFormFactor (167 ms)
[1459/1459] PointerMetricsRecorderTest.DownEventPerDestination (144 ms)

The initial run fails because a histogram can't be found:
[ RUN      ] PointerMetricsRecorderTest.DownEventPerFormFactor
../../base/test/histogram_tester.cc:55: Failure
Expected: (nullptr) != (histogram), actual: 8-byte object <00-00 00-00 00-00 00-00> vs NULL
Histogram "Event.DownEventCount.PerFormFactor" does not exist.
../../base/test/histogram_tester.cc:55: Failure
Expected: (nullptr) != (histogram), actual: 8-byte object <00-00 00-00 00-00 00-00> vs NULL
Histogram "Event.DownEventCount.PerFormFactor" does not exist.
[  FAILED  ] PointerMetricsRecorderTest.DownEventPerFormFactor (55 ms)

There are similar issues in SystemTrayTest for tests that record histograms.

I think the problem is that the base::StatisticsRecorder is not being initialized in the ash test suite, so it gets lazily initialized by some random HistogramTester, and depending on which tests run in the same batch the initialization may not happen at the right time.

I have a fix, I just need to understand better why the fix works.

 
Project Member

Comment 1 by bugdroid1@chromium.org, May 23 2017

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

commit 8cd44d248f4d7439aeb914c5e7ca4b74df94563f
Author: jamescook <jamescook@chromium.org>
Date: Tue May 23 17:11:14 2017

chromeos: Initialize StatisticsRecorder in AshTestSuite

This fixes flake in ash_unittests in tests that record and read back
histograms, in particular PointerMetricsRecorderTest.

This is similar to the initialization in ComponentsTestSuite,
ContentTestSuiteBase, etc.

BUG= 725287 
TEST=run ash_unittests locally, PointerMetricsRecorderTest doesn't retry

Review-Url: https://codereview.chromium.org/2901703002
Cr-Commit-Position: refs/heads/master@{#473952}

[modify] https://crrev.com/8cd44d248f4d7439aeb914c5e7ca4b74df94563f/ash/test/ash_test_suite.cc

Status: Fixed (was: Started)

Comment 3 by dchan@chromium.org, Aug 1 2017

Labels: VerifyIn-61

Comment 4 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment