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

github-merge-queue[bot] pushed a commit to branch 
gh-readonly-queue/release/v1.2/pr-7402-e49f3379f1a5eac75d7fbfbb54a14503f168da87
in repository https://gitbox.apache.org/repos/asf/texera.git

commit fc9387d3cf063a309ea1e0c9cfedd2b911046db6
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Sep 4 01:02:54 2026 +0000

    fix(pyamber, test, v1.2): stabilize flaky AtomicInteger get_and_set 
deadlock test (#7402)
    
    ### What changes were proposed in this PR?
    
    Automated backport of #7295 to `release/v1.2`.
    
    Source: d2fe4ba34e0e76679eb14499c854d487ed953a09 ยท [automation
    run](https://github.com/apache/texera/actions/runs/31231086260)
    
    ### Any related issues, documentation, discussions?
    
    Backport of #7295. Originally linked #7294.
    
    ### How was this PR tested?
    
    Release-branch CI runs on this branch once the build is fixed and this
    PR is marked ready for review.
    
    ### Was this PR authored or co-authored using generative AI tooling?
    
    No.
    
    Co-authored-by: Meng Wang <[email protected]>
    Co-authored-by: Yicong Huang 
<[email protected]>
---
 amber/src/test/python/core/util/test_atomic.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/amber/src/test/python/core/util/test_atomic.py 
b/amber/src/test/python/core/util/test_atomic.py
index 824b25b671..c8021234e0 100644
--- a/amber/src/test/python/core/util/test_atomic.py
+++ b/amber/src/test/python/core/util/test_atomic.py
@@ -85,8 +85,11 @@ class TestAtomicIntegerSingleThreaded:
         # scheduling delay alone could let the assertions below pass even on
         # a fixed implementation.
         assert started.wait(timeout=2.0), "worker thread never started"
-        # Give get_and_set a moment to either deadlock or return.
-        completed.wait(timeout=0.5)
+        # Join instead of waiting on `completed`: the worker sets that event
+        # before it exits, so `is_alive()` is only reliable after a join. A
+        # fixed implementation joins in microseconds; a deadlocked get_and_set
+        # stays alive past the timeout and still trips the assertion below.
+        worker.join(timeout=5)
         assert not errors, (
             f"get_and_set raised before reaching the deadlock spin: 
{errors[0]!r}"
         )

Reply via email to