This is an automated email from the ASF dual-hosted git repository.

changchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new 67935d1cd4 [GLUTEN-11406][VL][UT][MINOR] Fix unstable memory test in 
UnsafeColumnarBuildSideRelationTest (#11475)
67935d1cd4 is described below

commit 67935d1cd4fe69414779f96108ce5fb32edc3bc9
Author: Chang Chen <[email protected]>
AuthorDate: Mon Jan 26 12:50:26 2026 +0800

    [GLUTEN-11406][VL][UT][MINOR] Fix unstable memory test in 
UnsafeColumnarBuildSideRelationTest (#11475)
    
    * Fix unstable memory test by triggering GC before recording 
initialGlobalBytes in beforeAll()
    * Fix comment for SPARK-47289 test exclusion in Spark 4.1 profile. Apply 
the same fix from commit 08625a354ed910e485ca4b2fce27808a89ff117b to Spark 4.1 
profile.
---
 .../execution/unsafe/UnsafeColumnarBuildSideRelationTest.scala    | 8 ++++++--
 .../scala/org/apache/gluten/utils/velox/VeloxTestSettings.scala   | 3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/backends-velox/src/test/scala/org/apache/spark/sql/execution/unsafe/UnsafeColumnarBuildSideRelationTest.scala
 
b/backends-velox/src/test/scala/org/apache/spark/sql/execution/unsafe/UnsafeColumnarBuildSideRelationTest.scala
index 82adee0375..41400f613f 100644
--- 
a/backends-velox/src/test/scala/org/apache/spark/sql/execution/unsafe/UnsafeColumnarBuildSideRelationTest.scala
+++ 
b/backends-velox/src/test/scala/org/apache/spark/sql/execution/unsafe/UnsafeColumnarBuildSideRelationTest.scala
@@ -61,6 +61,10 @@ class UnsafeColumnarBuildSideRelationTest extends 
SharedSparkSession {
 
   override def beforeAll(): Unit = {
     super.beforeAll()
+    // Trigger GC to clean up any residual memory from previous test suites,
+    // ensuring initialGlobalBytes is accurate.
+    System.gc()
+    Thread.sleep(1000)
     initialGlobalBytes = GlobalOffHeapMemory.currentBytes()
     output = Seq(AttributeReference("a", StringType, nullable = false, null)())
     sample1KBytes = randomBytes(1024)
@@ -75,8 +79,8 @@ class UnsafeColumnarBuildSideRelationTest extends 
SharedSparkSession {
     unsafeRelWithHashMode = null
     System.gc()
     Thread.sleep(1000)
-    // FIXME: This should be zero. We had to assert with the initial bytes 
because
-    //  there were some allocations from the previous run suites.
+    // Since we trigger GC in beforeAll() to clean up residual memory from 
previous test suites,
+    // initialGlobalBytes should be accurate and this assertion should be 
stable.
     assert(GlobalOffHeapMemory.currentBytes() == initialGlobalBytes)
   }
 
diff --git 
a/gluten-ut/spark41/src/test/scala/org/apache/gluten/utils/velox/VeloxTestSettings.scala
 
b/gluten-ut/spark41/src/test/scala/org/apache/gluten/utils/velox/VeloxTestSettings.scala
index 9cf46bf1fa..83ce6d20b1 100644
--- 
a/gluten-ut/spark41/src/test/scala/org/apache/gluten/utils/velox/VeloxTestSettings.scala
+++ 
b/gluten-ut/spark41/src/test/scala/org/apache/gluten/utils/velox/VeloxTestSettings.scala
@@ -1013,7 +1013,8 @@ class VeloxTestSettings extends BackendTestSettings {
     .exclude("Logging plan changes for execution")
     // Rewrite for transformed plan
     .exclude("dumping query execution info to a file - explainMode=formatted")
-    // TODO: fix in Spark-4.0
+    // The case doesn't need to be run in Gluten since it's verifying against
+    // vanilla Spark's query plan.
     .exclude("SPARK-47289: extended explain info")
   enableSuite[GlutenSQLMetricsSuite]
   override def getSQLQueryTestSettings: SQLQueryTestSettings = 
VeloxSQLQueryTestSettings


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to