tests.test_observers_winapi.test___init__() fails locally on Python 3.11.2 on Windows 11
altendky opened this issue · comments
tests.test_observers_winapi.test___init__()
fails locally on Python 3.11.2 on Windows 11.
watchdog/tests/test_observers_winapi.py
Lines 68 to 99 in 1838e0b
> assert expected == got
E AssertionError: assert {<DirMovedEvent: src_path='C:\\Users\\sda\\AppData\\Local\\Temp\\tmpym4vynjz\\Strange ☃\\fromdir', dest_path='C:\\Users\\sda\\AppData\\Local\\Temp\\tmpym4vynjz\\Strange ☃\\todir', is_directory=True>, <DirCreatedEvent: event_type=created, src_path='C:\\Users\\sda\\AppData\\Local\\Temp\\tmpym4vynjz\\Strange ☃\\fromdir', is_directory=True} == {<DirMovedEvent: src_path='C:\\Users\\sda\\AppData\\Local\\Temp\\tmpym4vynjz\\Strange ☃\\fromdir', dest_path='C:\\Users\\sda\\AppData\\Local\\Temp\\tmpym4vynjz\\Strange ☃\\todir', is_directory=True>, <DirModifiedEvent: event_type=modified, src_path='C:\\Users\\sda\\AppData\\Local\\Temp\\tmpym4vynjz\\Strange ☃\\todir', is_directory=True, <DirCreatedEvent: event_type=created, src_path='C:\\Users\\sda\\AppData\\Local\\Temp\\tmpym4vynjz\\Strange ☃\\fromdir', is_directory=True}
E Extra items in the right set:
E <DirModifiedEvent: event_type=modified, src_path='C:\\Users\\sda\\AppData\\Local\\Temp\\tmpym4vynjz\\Strange ☃\\todir', is_directory=True
E Full diff:
E {
E <DirCreatedEvent: event_type=created, src_path='C:\\Users\\sda\\AppData\\Local\\Temp\\tmpym4vynjz\\Strange ☃\\fromdir', is_directory=True,
E - <DirModifiedEvent: event_type=modified, src_path='C:\\Users\\sda\\AppData\\Local\\Temp\\tmpym4vynjz\\Strange ☃\\todir', is_directory=True,
E <DirMovedEvent: src_path='C:\\Users\\sda\\AppData\\Local\\Temp\\tmpym4vynjz\\Strange ☃\\fromdir', dest_path='C:\\Users\\sda\\AppData\\Local\\Temp\\tmpym4vynjz\\Strange ☃\\todir', is_directory=True>,
E }
I have various tests that consistently fail locally in Linux and Windows. Let's start with this one and see what I learn first.
To be more clear @BoboTiG, I'm curious what commentary you have on this. I don't know the history or what to expect in different environments. Like, is this more likely a misdetection or is the move resulting in both the creation and actually a second modification to... force the attributes to match? I dunno.
What is interesting is that those tests pass on the CI, correct?
Do you are running tests in WSL, maybe?
A Windows 11 Pro virtual machine in VirtualBox from a Linux host with a dedicated virtual disk formatted by the Windows installer. And yes, they seem to pass.
https://github.com/gorakhargosh/watchdog/actions/runs/4455642986/jobs/7825573830#step:5:143
tests/test_observers_winapi.py::test___init__ PASSED [ 72%]
That's why I'm hoping someone has practical knowledge around why the event would happen locally, albeit in a VM, and not on the server. I guess the filesystem could be entirely different in the GitHub workers, so maybe I ought to figure out how to report that as a reference.