From: Eli Zaretskii Date: Mon, 14 Jul 2025 12:48:45 +0000 (+0300) Subject: ; Fix 'threads-join-error' test X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=73228512a826c2ab971ffb808e2a77b5a5361ebf;p=emacs.git ; Fix 'threads-join-error' test * test/src/thread-tests.el (threads-thread-sleeps): New helper function. (threads-join-error): Fix to work as intended, and remove the 'unstable' tag. (Bug#40823) (cherry picked from commit d0f96de277ff89adae4bc29ce934b7fca1d9bf00) --- diff --git a/test/src/thread-tests.el b/test/src/thread-tests.el index 322547c2e6a..9a065187b5e 100644 --- a/test/src/thread-tests.el +++ b/test/src/thread-tests.el @@ -111,14 +111,19 @@ (skip-unless (featurep 'threads)) (should-error (thread-join (current-thread)))) +(defun threads-thread-sleeps () + "Put current thread to sleep." + (sleep-for 5)) + (ert-deftest threads-join-error () "Test of error signaling from `thread-join'." - :tags '(:unstable) (skip-unless (featurep 'threads)) - (let ((thread (make-thread #'threads-call-error))) - (while (thread-live-p thread) - (thread-yield)) - (should-error (thread-join thread)))) + (let ((thread (make-thread #'threads-thread-sleeps)) + err) + (thread-signal thread 'error "Error signal for thread") + (thread-yield) + (setq err (should-error (thread-join thread))) + (should (equal err '(error . "Error signal for thread"))))) (defvar threads-test-binding nil)