emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/kqueue 4e4180a: Improve loops in file-notify-test0


From: Michael Albinus
Subject: [Emacs-diffs] scratch/kqueue 4e4180a: Improve loops in file-notify-test06-many-events
Date: Thu, 19 Nov 2015 15:58:00 +0000

branch: scratch/kqueue
commit 4e4180a478aba1f3b66adaab8c0284d215ad6e03
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Improve loops in file-notify-test06-many-events
    
    * test/automated/file-notify-tests.el (file-notify-test06-many-events):
    Use `read-event' pauses for the `write-file' loops; otherwise
    events are lost in inotify and gfilenotify cases.
---
 test/automated/file-notify-tests.el |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/test/automated/file-notify-tests.el 
b/test/automated/file-notify-tests.el
index b9cd192..81fb42e 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -657,10 +657,12 @@ Don't wait longer than timeout seconds for the events to 
be delivered."
           (push (expand-file-name (format "x%d" i)) x-file-list)
           (push (expand-file-name (format "y%d" i)) y-file-list))
         (file-notify--test-with-events (make-list (+ n n) 'created)
-          (dolist (file x-file-list)
-            (write-region "" nil file nil 'no-message))
-          (dolist (file y-file-list)
-            (write-region "" nil file nil 'no-message)))
+          (let ((x-file-list x-file-list)
+                (y-file-list y-file-list))
+            (while (and x-file-list y-file-list)
+              (write-region "" nil (pop x-file-list) nil 'no-message)
+              (read-event nil nil 0.1)
+              (write-region "" nil (pop y-file-list) nil 'no-message))))
         (file-notify--test-with-events (make-list n 'renamed)
           (let ((x-file-list x-file-list)
                 (y-file-list y-file-list))
@@ -672,7 +674,7 @@ Don't wait longer than timeout seconds for the events to be 
delivered."
     (file-notify--test-cleanup)))
 
 (file-notify--deftest-remote file-notify-test06-many-events
-   "Check that events are not dropped remote directories.")
+   "Check that events are not dropped for remote directories.")
 
 (defun file-notify-test-all (&optional interactive)
   "Run all tests for \\[file-notify]."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]