From 642f0677f0c3436ed55a851f46525fa5c07350c3 Mon Sep 17 00:00:00 2001 From: Christopher Wirt Date: Mon, 16 Nov 2026 13:28:13 +0000 Subject: [PATCH] test(java): fix two tests that fail against release native builds - VortexV1FallbackTest.readsMissingColumnsWithCodegen reads two files with different columns, so it must opt into vortex.mergeSchema, which defaults to false since #105. - ExpressionReachabilityTest's child JVM ran out of heap with an optimized native library: the loop creates expressions faster than the Cleaner releases them, and their cleanables filled the 32 MB heap. The GC thread supplies the GC pressure, so the child now gets 256 MB. Both failed on vortex-build's release build with RUN_TESTS, and both now pass locally against a release libvortex_jni. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Christopher Wirt --- .../java/dev/vortex/api/ExpressionReachabilityTest.java | 6 ++++-- .../test/java/dev/vortex/spark/VortexV1FallbackTest.java | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/java/vortex-jni/src/test/java/dev/vortex/api/ExpressionReachabilityTest.java b/java/vortex-jni/src/test/java/dev/vortex/api/ExpressionReachabilityTest.java index 05b8f937d63..a92b07acce9 100644 --- a/java/vortex-jni/src/test/java/dev/vortex/api/ExpressionReachabilityTest.java +++ b/java/vortex-jni/src/test/java/dev/vortex/api/ExpressionReachabilityTest.java @@ -40,8 +40,10 @@ void temporaryLiteralInputsSurviveNativeCalls() throws Exception { List command = new ArrayList<>(); command.add(Path.of(System.getProperty("java.home"), "bin", "java").toString()); command.addAll(List.of( - "-Xms32m", - "-Xmx32m", + // The GC thread below forces collections. The heap must still hold the cleanables an optimized + // native library lets the loop create faster than the Cleaner thread releases them. + "-Xms256m", + "-Xmx256m", "-Xbatch", "-XX:-TieredCompilation", "-XX:CompileThreshold=100", diff --git a/java/vortex-spark/common/src/test/java/dev/vortex/spark/VortexV1FallbackTest.java b/java/vortex-spark/common/src/test/java/dev/vortex/spark/VortexV1FallbackTest.java index 047c610d170..a2cfb263309 100644 --- a/java/vortex-spark/common/src/test/java/dev/vortex/spark/VortexV1FallbackTest.java +++ b/java/vortex-spark/common/src/test/java/dev/vortex/spark/VortexV1FallbackTest.java @@ -99,8 +99,12 @@ void readsMissingColumnsWithCodegen() { .mode(SaveMode.Append) .save(output.toString()); - Dataset data = - spark.read().format("vortex").load(output.toString()).orderBy("id"); + // Only a merged schema has the second file's column. + Dataset data = spark.read() + .format("vortex") + .option("vortex.mergeSchema", "true") + .load(output.toString()) + .orderBy("id"); assertTrue(plan(data).contains("Batched: true"), plan(data)); List rows = data.collectAsList(); assertEquals(2, rows.size());