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

Issue 852200 link

Starred by 0 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

HistogramTesterTest.Scope fails when ran repeatedly/randomdly

Project Member Reported by wfh@chromium.org, Jun 13 2018

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.
 

Comment 1 by wfh@chromium.org, Jun 13 2018

This only seems to fail after https://chromium-review.googlesource.com/c/chromium/src/+/1091213 so adding my test broke another test. I still think each test should be independent though, but now not sure what is at fault.

Comment 2 by wfh@chromium.org, 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.
Are you going to investigate this?  Otherwise it can probably be assigned to bcwhite@, who I think is familiar with the logic here.

Comment 4 by wfh@chromium.org, Jun 13 2018

Status: Available (was: Untriaged)
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.
Labels: -Pri-2 Pri-3
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