HistogramTesterTest.Scope fails when ran repeatedly/randomdly |
|||
Issue description
I am using git checkout afd30ba298691
To reproduce:
out\goma64\base_unittests --gtest_filter=HistogramTesterTest.* --gtest_repeat=20 --gtest_shuffle
This causes failure:
[ RUN ] HistogramTesterTest.Scope
[27308:50988:0612/174221.009:2879400546:ERROR:histogram.cc(242)] Histogram Test1 has mismatched construction arguments
[27308:50988:0612/174221.009:2879400546:ERROR:histogram.cc(242)] Histogram Test1 has mismatched construction arguments
../../base/test/metrics/histogram_tester_unittest.cc(48): error: Expected equality of these values:
1
samples->TotalCount()
Which is: 0
Stack trace:
Backtrace:
testing::internal::UnitTestImpl::CurrentOsStackTraceExceptTop [0x00007FF6C2A04E0F+87] (C:\src\gclient\src\third_party\googletest\src\googletest\src\gtest.cc:810)
testing::internal::AssertHelper::operator= [0x00007FF6C2A049B4+78] (C:\src\gclient\src\third_party\googletest\src\googletest\src\gtest.cc:382)
base::HistogramTesterTest_Scope_Test::TestBody [0x00007FF6C27ED753+659] (C:\src\gclient\src\base\test\metrics\histogram_tester_unittest.cc:48)
[ FAILED ] HistogramTesterTest.Scope (296 ms)
This was found while adding my own test here.
,
Jun 13 2018
Minimized command line:
out/gn/base_unittests --gtest_filter=HistogramTesterTest.TestGetAllChangedHistograms:HistogramTesterTest.Scope --gtest_shuffle --gtest_random_seed=1
TL;DR; when TestGetAllChangedHistograms runs before Scope, Scope fails.
This is because GetHistogramSamplesSinceCreation is returning the sample recorded to kHistogram1 by TestGetAllChangedHistograms.
I don't think the comment on GetHistogramSamplesSinceCreation is accurate - it states:
// Access a modified HistogramSamples containing only what has been logged
// to the histogram since the creation of this object.
std::unique_ptr<HistogramSamples> GetHistogramSamplesSinceCreation(
const std::string& histogram_name) const;
but it's not doing this, it's also returning samples that existed before the creation of the object.
,
Jun 13 2018
Are you going to investigate this? Otherwise it can probably be assigned to bcwhite@, who I think is familiar with the logic here.
,
Jun 13 2018
No, I wasn't going to investigate this any further. I don't think it's particularly high priority to fix this either, it was just a bit odd.
,
Jun 13 2018
Okay, I agree; the flakiness dashboard doesn't make it look like this test is flaky enough to be an issue in practice. https://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=base_unittests%20(with%20patch)&tests=HistogramTesterTest.Scope |
|||
►
Sign in to add a comment |
|||
Comment 1 by wfh@chromium.org
, Jun 13 2018