aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2025-07-14 15:48:45 +0300
committerEli Zaretskii2025-07-14 15:48:45 +0300
commitd0f96de277ff89adae4bc29ce934b7fca1d9bf00 (patch)
tree390b2c0a59c9ad0573dfb7f476124b5ec2459a74
parent817f7829f9cdb47d2bcdee95ffc97830537c490d (diff)
downloademacs-d0f96de277ff89adae4bc29ce934b7fca1d9bf00.tar.gz
emacs-d0f96de277ff89adae4bc29ce934b7fca1d9bf00.zip
; 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)
-rw-r--r--test/src/thread-tests.el15
1 files changed, 10 insertions, 5 deletions
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 @@
111 (skip-unless (featurep 'threads)) 111 (skip-unless (featurep 'threads))
112 (should-error (thread-join (current-thread)))) 112 (should-error (thread-join (current-thread))))
113 113
114(defun threads-thread-sleeps ()
115 "Put current thread to sleep."
116 (sleep-for 5))
117
114(ert-deftest threads-join-error () 118(ert-deftest threads-join-error ()
115 "Test of error signaling from `thread-join'." 119 "Test of error signaling from `thread-join'."
116 :tags '(:unstable)
117 (skip-unless (featurep 'threads)) 120 (skip-unless (featurep 'threads))
118 (let ((thread (make-thread #'threads-call-error))) 121 (let ((thread (make-thread #'threads-thread-sleeps))
119 (while (thread-live-p thread) 122 err)
120 (thread-yield)) 123 (thread-signal thread 'error "Error signal for thread")
121 (should-error (thread-join thread)))) 124 (thread-yield)
125 (setq err (should-error (thread-join thread)))
126 (should (equal err '(error . "Error signal for thread")))))
122 127
123(defvar threads-test-binding nil) 128(defvar threads-test-binding nil)
124 129