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

zhangshenghang pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new 22da84a418 [Test][API] Tolerate the pre-existing close() race in the 
schema-change worker-failure test (#11726)
22da84a418 is described below

commit 22da84a418beeb95123efe43f369d117c5378039
Author: Daniel <[email protected]>
AuthorDate: Tue Aug 11 20:52:00 2026 +0800

    [Test][API] Tolerate the pre-existing close() race in the schema-change 
worker-failure test (#11726)
    
    Co-authored-by: DanielLeens <[email protected]>
---
 .../MultiTableSinkWriterSchemaChangeBroadcastTest.java  | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git 
a/seatunnel-api/src/test/java/org/apache/seatunnel/api/sink/multitablesink/MultiTableSinkWriterSchemaChangeBroadcastTest.java
 
b/seatunnel-api/src/test/java/org/apache/seatunnel/api/sink/multitablesink/MultiTableSinkWriterSchemaChangeBroadcastTest.java
index 853ef7febd..4f2f462877 100644
--- 
a/seatunnel-api/src/test/java/org/apache/seatunnel/api/sink/multitablesink/MultiTableSinkWriterSchemaChangeBroadcastTest.java
+++ 
b/seatunnel-api/src/test/java/org/apache/seatunnel/api/sink/multitablesink/MultiTableSinkWriterSchemaChangeBroadcastTest.java
@@ -409,7 +409,22 @@ public class MultiTableSinkWriterSchemaChangeBroadcastTest 
{
                                         new TestSchemaChangeEvent(
                                                 TablePath.of("dbA", null, 
"users"))));
         assertEquals("boom-before-schema-entry", 
schemaChangeFailure.getMessage());
-        coordinator.close();
+        // checkQueueRemain() (invoked by close()) only re-checks 
subSinkErrorCheck() while a
+        // queue element still looks pending, and MultiTableWriterRunnable 
clears that pending
+        // flag in a separate volatile write issued after the worker's 
throwable field is already
+        // stored (MultiTableWriterRunnable.run()). Whether close() observes 
that narrow window
+        // and re-surfaces the same row failure is a timing race in existing 
close() behavior, not
+        // a regression and not what this test verifies above. Tolerate either 
outcome, but fail
+        // if close() surfaces anything other than the exact failure already 
asserted.
+        try {
+            coordinator.close();
+        } catch (RuntimeException e) {
+            org.junit.jupiter.api.Assertions.assertSame(
+                    rowWriteFailure,
+                    e.getCause(),
+                    "close() surfaced an unexpected failure instead of the 
known row failure: "
+                            + e);
+        }
     }
 
     /**

Reply via email to