emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 57be62f: Solve timimg issues in file-notify-tests.e


From: Michael Albinus
Subject: [Emacs-diffs] master 57be62f: Solve timimg issues in file-notify-tests.el
Date: Sat, 17 Oct 2015 09:20:17 +0000

branch: master
commit 57be62f97b8442218f4fa6979cf27b36d5d5f540
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Solve timimg issues in file-notify-tests.el
    
    * test/automated/file-notify-tests.el (file-notify-test02-events):
    Rectify `attribute-change' tests.  There are timing issues with
    gfilenotify.
---
 test/automated/file-notify-tests.el |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/test/automated/file-notify-tests.el 
b/test/automated/file-notify-tests.el
index c943d91..1763648 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -325,12 +325,24 @@ Don't wait longer than TIMEOUT seconds for the events to 
be delivered."
                  file-notify--test-tmpfile
                  '(attribute-change) 'file-notify--test-event-handler))
           (file-notify--test-with-events
-              (file-notify--test-timeout) '(attribute-changed 
attribute-changed)
+              (file-notify--test-timeout) '(attribute-changed)
+            (write-region
+             "any text" nil file-notify--test-tmpfile nil 'no-message)
+            (set-file-modes file-notify--test-tmpfile 000)
+            (delete-file file-notify--test-tmpfile))
+          (file-notify-rm-watch file-notify--test-desc)
+
+          ;; With gfilenotify, there are timing issues with attribute
+          ;; changes in a short time period.  So we apply 2 tests.
+          (setq file-notify--test-desc
+                (file-notify-add-watch
+                 file-notify--test-tmpfile
+                 '(attribute-change) 'file-notify--test-event-handler))
+          (file-notify--test-with-events
+              (file-notify--test-timeout) '(attribute-changed)
             (write-region
              "any text" nil file-notify--test-tmpfile nil 'no-message)
             (set-file-modes file-notify--test-tmpfile 000)
-            (read-event nil nil 0.1) ; In order to distinguish the events.
-            (set-file-times file-notify--test-tmpfile '(0 0))
             (delete-file file-notify--test-tmpfile))
           (file-notify-rm-watch file-notify--test-desc))
 



reply via email to

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