From 874c4b49268f2a4216e434afb0ff3c9c58098726 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Fri, 20 Dec 2024 20:11:35 -0800 Subject: [PATCH] Remove MapperFootprintTest, its deps --- pom.xml | 11 ------ .../jackson/databind/MapperFootprintTest.java | 38 ------------------- 2 files changed, 49 deletions(-) delete mode 100644 src/test/java/tools/jackson/databind/MapperFootprintTest.java diff --git a/pom.xml b/pom.xml index 033f5e90b2..0311c7d63c 100644 --- a/pom.xml +++ b/pom.xml @@ -138,14 +138,6 @@ test - - - org.openjdk.jol - jol-core - 0.16 - test - - @@ -217,9 +209,6 @@ javax.measure:jsr-275 - - tools.jackson.databind.MapperFootprintTest - diff --git a/src/test/java/tools/jackson/databind/MapperFootprintTest.java b/src/test/java/tools/jackson/databind/MapperFootprintTest.java deleted file mode 100644 index 5a1b361975..0000000000 --- a/src/test/java/tools/jackson/databind/MapperFootprintTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package tools.jackson.databind; - -import com.google.common.testing.GcFinalization; -import org.junit.jupiter.api.Test; -import org.openjdk.jol.info.GraphLayout; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class MapperFootprintTest { - /* - * Note: this class is run in an isolated execution in surefire. The test is too flaky with all the other tests - * running in the same JVM. - */ - - @Test - public void testMapperFootprint() throws InterruptedException { - // memory footprint limit for the ObjectMapper - - // force gc (see javadoc of GraphLayout.subtract) - GcFinalization.awaitFullGc(); - // do this calculation twice. If there's a GC in one case, and the subtract call doesn't work well because of - // this, we can fall back to the other. - GraphLayout mapperLayoutA = GraphLayout.parseInstance(new ObjectMapper()) - .subtract(GraphLayout.parseInstance(new ObjectMapper())); - GraphLayout mapperLayoutB = GraphLayout.parseInstance(new ObjectMapper()) - .subtract(GraphLayout.parseInstance(new ObjectMapper())); - GraphLayout mapperLayout = mapperLayoutA.totalSize() > mapperLayoutB.totalSize() ? - mapperLayoutB : mapperLayoutA; - - // 29-Nov-2022, tatu: Should be under 10k, but... flakiness. - final int maxByteSize = 20_000; - assertTrue( - mapperLayout.totalSize() < maxByteSize, - "ObjectMapper memory footprint ("+mapperLayout.totalSize() - +") exceeded limit ("+maxByteSize - +"). Footprint details: " + mapperLayout.toFootprint()); - } -}