Commit c2d5e408 authored by Omer Katz's avatar Omer Katz Committed by V8 LUCI CQ

cppgc: Reduce noise and increase tolerance in flaky test

Bug: v8:11367
Change-Id: I2d21d3deea73a9930acb3bf2efd3268ec1fd64b4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2919830Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74788}
parent d2a4e8ec
......@@ -153,6 +153,12 @@ TEST_F(MetricRecorderTest, CycleEndMetricsReportedOnGcEnd) {
TEST_F(MetricRecorderTest, CycleEndHistogramReportsCorrectValues) {
StartGC();
{
// Warmup scope to make sure everything is loaded in memory and reduce noise
// in timing measurements.
StatsCollector::EnabledScope scope(Heap::From(GetHeap())->stats_collector(),
StatsCollector::kIncrementalMark);
}
EndGC(1000);
StartGC();
{
......@@ -207,7 +213,7 @@ TEST_F(MetricRecorderTest, CycleEndHistogramReportsCorrectValues) {
}
EndGC(300);
// Check durations.
static constexpr int64_t kDurationComparisonTolerance = 500;
static constexpr int64_t kDurationComparisonTolerance = 5000;
EXPECT_LT(std::abs(MetricRecorderImpl::CppGCFullCycle_event
.main_thread_incremental.mark_duration_us -
10000),
......@@ -269,7 +275,7 @@ TEST_F(MetricRecorderTest, CycleEndHistogramReportsCorrectValues) {
// Check collection rate and efficiency.
EXPECT_DOUBLE_EQ(
0.3, MetricRecorderImpl::CppGCFullCycle_event.collection_rate_in_percent);
static constexpr double kEfficiencyComparisonTolerance = 0.00001;
static constexpr double kEfficiencyComparisonTolerance = 0.0005;
EXPECT_LT(
std::abs(
MetricRecorderImpl::CppGCFullCycle_event.efficiency_in_bytes_per_us -
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment