From b0af4d2bc412e5509232c3bb3db602cbe30a285b Mon Sep 17 00:00:00 2001 From: Lokesh Gidra Date: Wed, 22 Jan 2025 19:39:22 +0000 Subject: Disable GCMetric.GCDuration and GCDurationDelta gtests The GC invoked before asserting that the two metrics are non-zero are too small. We need to make them consume more time. Otherwise there is always a possiblity that the GCs take less than a millisecond and hence the tests fail. Bug: 391531096 Bug: 343220989 Test: atest art_standalone_runtime_tests:art_standalone_runtime_tests.HeapTest#GCMetrics -- --abi x86_64 Change-Id: I0c3220b57a16fc85429c493c62c5932ac97ea854 --- runtime/gc/heap_test.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'runtime/gc/heap_test.cc') diff --git a/runtime/gc/heap_test.cc b/runtime/gc/heap_test.cc index 18e91da75d..74d2970c0d 100644 --- a/runtime/gc/heap_test.cc +++ b/runtime/gc/heap_test.cc @@ -190,7 +190,7 @@ TEST_F(HeapTest, GCMetrics) { // young-generation collections) is null (b/271112044). Temporarily // suspend the following checks while we investigate. // - // TODO(b/271112044): Investigate and adjust these expectations and/or the + // TODO(b/271990567): Investigate and adjust these expectations and/or the // corresponding metric logic. #if 0 EXPECT_PRED2(AnyIsFalse, full_gc_duration->IsNull(), young_gc_duration->IsNull()); @@ -209,8 +209,15 @@ TEST_F(HeapTest, GCMetrics) { EXPECT_FALSE(full_gc_scanned_bytes_delta->IsNull()); EXPECT_FALSE(full_gc_freed_bytes->IsNull()); EXPECT_FALSE(full_gc_freed_bytes_delta->IsNull()); + // Like the generational case, these GC duration can be less than a + // millisecond here as well (b/391531096). Temporarily disabling the + // tests. + // TODO(b/271990567): Possibly make the GCs above more time consuming to + // avoid the situation. +#if 0 EXPECT_FALSE(full_gc_duration->IsNull()); EXPECT_FALSE(full_gc_duration_delta->IsNull()); +#endif EXPECT_TRUE(young_gc_collection_time->IsNull()); EXPECT_TRUE(young_gc_count->IsNull()); -- cgit v1.2.3-59-g8ed1b