mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8330022: Failure test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/BTreeTest.java: Could not initialize class java.util.concurrent.ThreadLocalRandom
Co-authored-by: David Leopoldseder <davleopo@openjdk.org> Reviewed-by: tschatzl, matsaave
This commit is contained in:
parent
fe29cad5e0
commit
4977588d5e
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -245,6 +245,12 @@ public final class GarbageUtils {
|
||||
}
|
||||
}
|
||||
|
||||
private static Throwable ultimateCause(Throwable t) {
|
||||
while (t.getCause() != null) {
|
||||
t = t.getCause();
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
public static int eatMemory(ExecutionController stresser, GarbageProducer gp, long initialFactor, long minMemoryChunk, long factor, OOM_TYPE type) {
|
||||
try {
|
||||
@ -253,6 +259,9 @@ public final class GarbageUtils {
|
||||
} catch (OutOfMemoryError e) {
|
||||
return numberOfOOMEs++;
|
||||
} catch (Throwable t) {
|
||||
if (ultimateCause(t) instanceof OutOfMemoryError) {
|
||||
return numberOfOOMEs++;
|
||||
}
|
||||
throw new RuntimeException(t);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user