dsoprea / PyInotify

An efficient and elegant inotify (Linux filesystem activity monitor) library for Python. Python 2 and 3 compatible.
GNU General Public License v2.0
242 stars 73 forks source link

test.sh fails #95

Open toravir opened 2 years ago

toravir commented 2 years ago

There are three failures - with 0.2.10 tag, same with 0.2.9:

spoke:PyInotify-0.2.9 $ ./test.sh 
test__cycle (tests.test_inotify.TestInotify) ... ok
test__get_event_names (tests.test_inotify.TestInotify) ... ok
test__international_naming_python2 (tests.test_inotify.TestInotify) ... SKIP: Not in Python 2
test__international_naming_python3 (tests.test_inotify.TestInotify) ... ok
test__automatic_new_watches_on_existing_paths (tests.test_inotify.TestInotifyTree) ... ok
test__automatic_new_watches_on_new_paths (tests.test_inotify.TestInotifyTree) ... FAIL
test__cycle (tests.test_inotify.TestInotifyTree) ... FAIL
test__renames (tests.test_inotify.TestInotifyTree) ... FAIL
test__cycle (tests.test_inotify.TestInotifyTrees) ... ok

======================================================================
FAIL: test__automatic_new_watches_on_new_paths (tests.test_inotify.TestInotifyTree)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/google/home/raviraju/tmp/PyInotify-0.2.9/tests/test_inotify.py", line 298, in test__automatic_new_watches_on_new_paths
    self.assertEqual(events, expected)
AssertionError: Lists differ: [(_IN[49 chars]16), ['IN_CREATE', 'IN_ISDIR'], '/tmp/tmpibzf29dx', 'folder1')] != [(_IN[49 chars]16), ['IN_ISDIR', 'IN_CREATE'], '/tmp/tmpibzf29dx', 'folder1')]

First differing element 0:
(_INO[47 chars]=16), ['IN_CREATE', 'IN_ISDIR'], '/tmp/tmpibzf29dx', 'folder1')
(_INO[47 chars]=16), ['IN_ISDIR', 'IN_CREATE'], '/tmp/tmpibzf29dx', 'folder1')

  [(_INOTIFY_EVENT(wd=1, mask=1073742080, cookie=0, len=16),
-   ['IN_CREATE', 'IN_ISDIR'],
+   ['IN_ISDIR', 'IN_CREATE'],
    '/tmp/tmpibzf29dx',
    'folder1')]
-------------------- >> begin captured logging << --------------------
inotify.adapters: DEBUG: Inotify handle is (3).
inotify.adapters: DEBUG: Adding initial watches on tree: [/tmp/tmpibzf29dx]
inotify.adapters: DEBUG: Adding watch: [/tmp/tmpibzf29dx]
inotify.adapters: DEBUG: Added watch (1): [/tmp/tmpibzf29dx]
inotify.adapters: DEBUG: A directory has been created. We're adding a watch on it (because we're being recursive): [/tmp/tmpibzf29dx/folder1]
inotify.adapters: DEBUG: Adding watch: [/tmp/tmpibzf29dx/folder1]
inotify.adapters: DEBUG: Added watch (2): [/tmp/tmpibzf29dx/folder1]
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: test__cycle (tests.test_inotify.TestInotifyTree)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/google/home/raviraju/tmp/PyInotify-0.2.9/tests/test_inotify.py", line 213, in test__cycle
    self.assertEqual(events, expected)
AssertionError: Lists differ: [(_IN[325 chars]T(wd=3, mask=256, cookie=0, len=16), ['IN_CREA[1517 chars] '')] != [(_IN[325 chars]T(wd=2, mask=256, cookie=0, len=16), ['IN_CREA[1517 chars]bb')]

First differing element 3:
(_INOTIFY_EVENT(wd=3, mask=256, cookie=0, len=16), ['IN_CREA[41 chars]le2')
(_INOTIFY_EVENT(wd=2, mask=256, cookie=0, len=16), ['IN_CREA[41 chars]le2')

  [(_INOTIFY_EVENT(wd=1, mask=256, cookie=0, len=16),
    ['IN_CREATE'],
    '/tmp/tmp276nhxa4',
    'seen_new_file1'),
   (_INOTIFY_EVENT(wd=1, mask=32, cookie=0, len=16),
    ['IN_OPEN'],
    '/tmp/tmp276nhxa4',
    'seen_new_file1'),
   (_INOTIFY_EVENT(wd=1, mask=8, cookie=0, len=16),
    ['IN_CLOSE_WRITE'],
    '/tmp/tmp276nhxa4',
    'seen_new_file1'),
-  (_INOTIFY_EVENT(wd=3, mask=256, cookie=0, len=16),
?                     ^

+  (_INOTIFY_EVENT(wd=2, mask=256, cookie=0, len=16),
?                     ^

    ['IN_CREATE'],
    '/tmp/tmp276nhxa4/aa',
    'seen_new_file2'),
-  (_INOTIFY_EVENT(wd=3, mask=32, cookie=0, len=16),
?                     ^

+  (_INOTIFY_EVENT(wd=2, mask=32, cookie=0, len=16),
?                     ^

    ['IN_OPEN'],
    '/tmp/tmp276nhxa4/aa',
    'seen_new_file2'),
-  (_INOTIFY_EVENT(wd=3, mask=8, cookie=0, len=16),
?                     ^

+  (_INOTIFY_EVENT(wd=2, mask=8, cookie=0, len=16),
?                     ^

    ['IN_CLOSE_WRITE'],
    '/tmp/tmp276nhxa4/aa',
    'seen_new_file2'),
-  (_INOTIFY_EVENT(wd=2, mask=256, cookie=0, len=16),
?                     ^

+  (_INOTIFY_EVENT(wd=3, mask=256, cookie=0, len=16),
?                     ^

    ['IN_CREATE'],
    '/tmp/tmp276nhxa4/bb',
    'seen_new_file3'),
-  (_INOTIFY_EVENT(wd=2, mask=32, cookie=0, len=16),
?                     ^

+  (_INOTIFY_EVENT(wd=3, mask=32, cookie=0, len=16),
?                     ^

    ['IN_OPEN'],
    '/tmp/tmp276nhxa4/bb',
    'seen_new_file3'),
-  (_INOTIFY_EVENT(wd=2, mask=8, cookie=0, len=16),
?                     ^

+  (_INOTIFY_EVENT(wd=3, mask=8, cookie=0, len=16),
?                     ^

    ['IN_CLOSE_WRITE'],
    '/tmp/tmp276nhxa4/bb',
    'seen_new_file3'),
   (_INOTIFY_EVENT(wd=1, mask=512, cookie=0, len=16),
    ['IN_DELETE'],
    '/tmp/tmp276nhxa4',
    'seen_new_file1'),
-  (_INOTIFY_EVENT(wd=3, mask=512, cookie=0, len=16),
?                     ^

+  (_INOTIFY_EVENT(wd=2, mask=512, cookie=0, len=16),
?                     ^

    ['IN_DELETE'],
    '/tmp/tmp276nhxa4/aa',
    'seen_new_file2'),
-  (_INOTIFY_EVENT(wd=2, mask=512, cookie=0, len=16),
?                     ^

+  (_INOTIFY_EVENT(wd=3, mask=512, cookie=0, len=16),
?                     ^

    ['IN_DELETE'],
    '/tmp/tmp276nhxa4/bb',
    'seen_new_file3'),
+  (_INOTIFY_EVENT(wd=2, mask=1024, cookie=0, len=0),
+   ['IN_DELETE_SELF'],
+   '/tmp/tmp276nhxa4/aa',
+   ''),
+  (_INOTIFY_EVENT(wd=2, mask=32768, cookie=0, len=0),
+   ['IN_IGNORED'],
+   '/tmp/tmp276nhxa4/aa',
+   ''),
   (_INOTIFY_EVENT(wd=1, mask=1073742336, cookie=0, len=16),
-   ['IN_DELETE', 'IN_ISDIR'],
+   ['IN_ISDIR', 'IN_DELETE'],
    '/tmp/tmp276nhxa4',
    'aa'),
   (_INOTIFY_EVENT(wd=3, mask=1024, cookie=0, len=0),
    ['IN_DELETE_SELF'],
-   '/tmp/tmp276nhxa4/aa',
?                     ^^

+   '/tmp/tmp276nhxa4/bb',
?                     ^^

    ''),
   (_INOTIFY_EVENT(wd=3, mask=32768, cookie=0, len=0),
    ['IN_IGNORED'],
-   '/tmp/tmp276nhxa4/aa',
?                     ^^

+   '/tmp/tmp276nhxa4/bb',
?                     ^^

    ''),
   (_INOTIFY_EVENT(wd=1, mask=1073742336, cookie=0, len=16),
-   ['IN_DELETE', 'IN_ISDIR'],
+   ['IN_ISDIR', 'IN_DELETE'],
    '/tmp/tmp276nhxa4',
-   'bb'),
?        ^

+   'bb')]
?        ^

-  (_INOTIFY_EVENT(wd=2, mask=1024, cookie=0, len=0),
-   ['IN_DELETE_SELF'],
-   '/tmp/tmp276nhxa4/bb',
-   ''),
-  (_INOTIFY_EVENT(wd=2, mask=32768, cookie=0, len=0),
-   ['IN_IGNORED'],
-   '/tmp/tmp276nhxa4/bb',
-   '')]
-------------------- >> begin captured logging << --------------------
inotify.adapters: DEBUG: Inotify handle is (3).
inotify.adapters: DEBUG: Adding initial watches on tree: [/tmp/tmp276nhxa4]
inotify.adapters: DEBUG: Adding watch: [/tmp/tmp276nhxa4]
inotify.adapters: DEBUG: Added watch (1): [/tmp/tmp276nhxa4]
inotify.adapters: DEBUG: Adding watch: [/tmp/tmp276nhxa4/bb]
inotify.adapters: DEBUG: Added watch (2): [/tmp/tmp276nhxa4/bb]
inotify.adapters: DEBUG: Adding watch: [/tmp/tmp276nhxa4/aa]
inotify.adapters: DEBUG: Added watch (3): [/tmp/tmp276nhxa4/aa]
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: test__renames (tests.test_inotify.TestInotifyTree)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/google/home/raviraju/tmp/PyInotify-0.2.9/tests/test_inotify.py", line 235, in test__renames
    self.assertEqual(events1, expected)
AssertionError: Lists differ: [(_IN[52 chars], ['IN_CREATE', 'IN_ISDIR'], '/tmp/tmpz4opxolh', 'old_folder')] != [(_IN[52 chars], ['IN_ISDIR', 'IN_CREATE'], '/tmp/tmpz4opxolh', 'old_folder')]

First differing element 0:
(_INO[50 chars]), ['IN_CREATE', 'IN_ISDIR'], '/tmp/tmpz4opxolh', 'old_folder')
(_INO[50 chars]), ['IN_ISDIR', 'IN_CREATE'], '/tmp/tmpz4opxolh', 'old_folder')

  [(_INOTIFY_EVENT(wd=1, mask=1073742080, cookie=0, len=16),
-   ['IN_CREATE', 'IN_ISDIR'],
+   ['IN_ISDIR', 'IN_CREATE'],
    '/tmp/tmpz4opxolh',
    'old_folder')]
-------------------- >> begin captured logging << --------------------
inotify.adapters: DEBUG: Inotify handle is (3).
inotify.adapters: DEBUG: Adding initial watches on tree: [/tmp/tmpz4opxolh]
inotify.adapters: DEBUG: Adding watch: [/tmp/tmpz4opxolh]
inotify.adapters: DEBUG: Added watch (1): [/tmp/tmpz4opxolh]
inotify.adapters: DEBUG: A directory has been created. We're adding a watch on it (because we're being recursive): [/tmp/tmpz4opxolh/old_folder]
inotify.adapters: DEBUG: Adding watch: [/tmp/tmpz4opxolh/old_folder]
inotify.adapters: DEBUG: Added watch (2): [/tmp/tmpz4opxolh/old_folder]
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 9 tests in 8.038s

FAILED (SKIP=1, failures=3)
spoke:PyInotify-0.2.9 $