From a4dcb8ef73a255be70fd0442fcf5e4696b2ed20c Mon Sep 17 00:00:00 2001 From: Helmut Eller Date: Wed, 11 Feb 2026 08:37:32 +0100 Subject: [PATCH] Use a helper thread to make the test more reliable * test/src/fns-tests.el (ft-weak-equal-table): With wide-ints, the test unexpecetly passed probably because some stray reference to '(key 0) was on the stack. With a helper thread, the test works as expected. --- test/src/fns-tests.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index b25fd6a09d8..eec3eef9eb9 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el @@ -1423,6 +1423,8 @@ (ert-deftest ft-weak-equal-table () :expected-result (if (fboundp 'igc--collect) :failed :passed) + (unless (featurep 'threads) + (ert-skip '(not (featurep 'threads)))) (let* ((h (make-hash-table :weakness 'key-or-value :test #'equal)) (n 10) (root nil)) @@ -1432,7 +1434,8 @@ (puthash key val h))) (should (= (hash-table-count h) n)) (ft--gc 'key) - (setq root (gethash '(key 0) h)) + (setq root (thread-join (make-thread (lambda () + (gethash '(key 0) h))))) (ft--gc 'key-or-value) (should (< (hash-table-count h) n)) (should (equal root (gethash '(key 0) h)))))