From b15cd9afb2c96a0d0ee3a3e2dbd72586bffdbcbb Mon Sep 17 00:00:00 2001 From: Malinin Andrey Date: Tue, 19 Nov 2024 20:21:27 +0800 Subject: [PATCH] Change startGc test according to improvements Signed-off-by: Malinin Andrey --- tests/runtime/common/gc/CMakeLists.txt | 2 +- tests/runtime/common/gc/startGc.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/runtime/common/gc/CMakeLists.txt b/tests/runtime/common/gc/CMakeLists.txt index 3ae0b8790..88e696d3d 100644 --- a/tests/runtime/common/gc/CMakeLists.txt +++ b/tests/runtime/common/gc/CMakeLists.txt @@ -133,7 +133,7 @@ add_dependencies(mm_tests # Use --gc-trigger-type=debug-never to control GC in the test. # In the test we don't need the runtime triggers GC during allocation. -panda_add_ecma_gc_test(FILE startGc.js OPTIONS "--gc-trigger-type=debug-never") +panda_add_ecma_gc_test(FILE startGc.js OPTIONS "--gc-trigger-type=debug-never" "--g1-region-garbage-rate-threshold=0") panda_add_ecma_gc_test(FILE scheduleGc.js OPTIONS "--gc-trigger-type=debug-never" "--gc-use-nth-alloc-trigger=true") panda_add_ecma_gc_test(FILE spaceTypeTest.js OPTIONS "--gc-type=g1-gc" "--run-gc-in-place=true") panda_add_ecma_gc_test(FILE concurrent.js OPTIONS "--gc-type=g1-gc" "--gc-trigger-type=debug-never") diff --git a/tests/runtime/common/gc/startGc.js b/tests/runtime/common/gc/startGc.js index 22efb0eb7..b2c8d83cf 100644 --- a/tests/runtime/common/gc/startGc.js +++ b/tests/runtime/common/gc/startGc.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -65,6 +65,10 @@ waitForFinishGC(task_discarded_id); // test mixed GC ref = newWeakRefInCollectibleTenured(); +// Add more garbage objects and trigger concurrent marking +// to add garbage regions into collection set +makeTenuredCollectible(); +waitForFinishGC(startGC("threshold")); gc = startGC("mixed"); waitForFinishGC(gc); assert(ref.deref() === undefined, "Mixed GC didn't collect weak ref"); -- Gitee