From 6738c1cc8cb720087c2c3fffcc98a410063cb381 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 30 Dec 2021 16:44:13 +0200 Subject: [PATCH] Fix multisession-tests on MS-Windows * test/lisp/emacs-lisp/multisession-tests.el (multi-test-files-simple): On MS-Windows and Haiku, wait before invoking the Emacs sub-process, not after, to ensure the later update is detected with 1-sec file time resolution. --- test/lisp/emacs-lisp/multisession-tests.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/lisp/emacs-lisp/multisession-tests.el b/test/lisp/emacs-lisp/multisession-tests.el index 57ca420488e..17457d9be2f 100644 --- a/test/lisp/emacs-lisp/multisession-tests.el +++ b/test/lisp/emacs-lisp/multisession-tests.el @@ -116,6 +116,10 @@ (should (= (multisession-value multisession--sfoo) 0)) (cl-incf (multisession-value multisession--sfoo)) (should (= (multisession-value multisession--sfoo) 1)) + ;; On Windows and Haiku, we don't have sub-second resolution, so + ;; let some time pass to make the "later" logic work. + (when (memq system-type '(windows-nt haiku)) + (sleep-for 0.6)) (call-process (concat invocation-directory invocation-name) nil t nil @@ -130,9 +134,6 @@ "" :synchronized t) (cl-incf (multisession-value multisession--sfoo)))))) - ;; On Windows, we don't have sub-second resolution. - (when (memq system-type '(windows-nt haiku)) - (sleep-for 2)) (should (= (multisession-value multisession--sfoo) 2))))) (ert-deftest multi-test-files-busy () -- 2.39.2