From 2c45eca15943826cb6bfbdf6e6fd88abc196e8f7 Mon Sep 17 00:00:00 2001
From: Thomas Schatzl <tschatzl@openjdk.org>
Date: Fri, 12 Apr 2024 07:22:06 +0000
Subject: [PATCH] 8328879: G1: Some gtests modify global state crashing the JVM
 during GC after JDK-8289822

Reviewed-by: iwalulya, kbarrett
---
 test/hotspot/gtest/gc/g1/test_freeRegionList.cpp | 2 +-
 test/hotspot/gtest/gc/g1/test_heapRegion.cpp     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/hotspot/gtest/gc/g1/test_freeRegionList.cpp b/test/hotspot/gtest/gc/g1/test_freeRegionList.cpp
index 91540f7b78d..4639f1c9694 100644
--- a/test/hotspot/gtest/gc/g1/test_freeRegionList.cpp
+++ b/test/hotspot/gtest/gc/g1/test_freeRegionList.cpp
@@ -34,7 +34,7 @@
 #include "unittest.hpp"
 
 // @requires UseG1GC
-TEST_VM(FreeRegionList, length) {
+TEST_OTHER_VM(FreeRegionList, length) {
   if (!UseG1GC) {
     return;
   }
diff --git a/test/hotspot/gtest/gc/g1/test_heapRegion.cpp b/test/hotspot/gtest/gc/g1/test_heapRegion.cpp
index e329a2b80ae..c274e1c8494 100644
--- a/test/hotspot/gtest/gc/g1/test_heapRegion.cpp
+++ b/test/hotspot/gtest/gc/g1/test_heapRegion.cpp
@@ -122,7 +122,7 @@ void VM_HeapRegionApplyToMarkedObjectsTest::doit() {
   region->set_top(old_top);
 }
 
-TEST_VM(HeapRegion, apply_to_marked_object) {
+TEST_OTHER_VM(HeapRegion, apply_to_marked_object) {
   if (!UseG1GC) {
     return;
   }