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.
Comment 1 by bugdroid1@chromium.org
, May 23 2017