Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expect_event(DirMovedEvent(p("dir1", "dir2"), p("dir2"))) -> raise Empty #1098

Open
Andrii-Osipov opened this issue Feb 12, 2025 · 1 comment

Comments

@Andrii-Osipov
Copy link

Andrii-Osipov commented Feb 12, 2025

Tests failed:

=========================== short test summary info ============================
FAILED tests/test_emitter.py::test_move_to - _queue.Empty
FAILED tests/test_emitter.py::test_fast_subdirectory_creation_deletion - _que...
FAILED tests/test_emitter.py::test_recursive_off - _queue.Empty
FAILED tests/test_emitter.py::test_recursive_on - _queue.Empty
FAILED tests/test_emitter.py::test_move_nested_subdirectories - _queue.Empty
FAILED tests/test_fsevents.py::test_watchdog_recursive - AssertionError: Did ...
== 6 failed, 155 passed, 9 skipped, 1 xfailed, 2 xpassed in 274.45s (0:04:34) ==
Command failed with exit code 1

Error:

_______________________ test_move_nested_subdirectories ________________________

p = <bound method Helper.joinpath of Helper(tmp='/private/var/folders/sy/f16zz6x50xz3113nwtb9bvq00000gp/T/pytest-of-builde...tters=[<FSEventsEmitter(Thread-35, started daemon 123145572818944)>], event_queue=<queue.Queue object at 0x10537ce80>)>
event_queue = <queue.Queue object at 0x10537ce80>
start_watching = <bound method Helper.start_watching of Helper(tmp='/private/var/folders/sy/f16zz6x50xz3113nwtb9bvq00000gp/T/pytest-of-...tters=[<FSEventsEmitter(Thread-35, started daemon 123145572818944)>], event_queue=<queue.Queue object at 0x10537ce80>)>
expect_event = <bound method Helper.expect_event of Helper(tmp='/private/var/folders/sy/f16zz6x50xz3113nwtb9bvq00000gp/T/pytest-of-bu...tters=[<FSEventsEmitter(Thread-35, started daemon 123145572818944)>], event_queue=<queue.Queue object at 0x10537ce80>)>

    @pytest.mark.skipif(platform.is_windows(), reason="Windows create another set of events for this test")
    def test_move_nested_subdirectories(
        p: P,
        event_queue: TestEventQueue,
        start_watching: StartWatching,
        expect_event: ExpectEvent,
    ) -> None:
        mkdir(p("dir1/dir2/dir3"), parents=True)
        mkfile(p("dir1/dir2/dir3", "a"))
        start_watching()
        mv(p("dir1/dir2"), p("dir2"))

>       expect_event(DirMovedEvent(p("dir1", "dir2"), p("dir2")))

event_queue = <queue.Queue object at 0x10537ce80>
expect_event = <bound method Helper.expect_event of Helper(tmp='/private/var/folders/sy/f16zz6x50xz3113nwtb9bvq00000gp/T/pytest-of-builder/pytest-4130/test_move_nested_subdirectorie0', emitters=[<FSEventsEmitter(Thread-35, started daemon 123145572818944)>], event_queue=<queue.Queue object at 0x10537ce80>)>
p          = <bound method Helper.joinpath of Helper(tmp='/private/var/folders/sy/f16zz6x50xz3113nwtb9bvq00000gp/T/pytest-of-builder/pytest-4130/test_move_nested_subdirectorie0', emitters=[<FSEventsEmitter(Thread-35, started daemon 123145572818944)>], event_queue=<queue.Queue object at 0x10537ce80>)>
start_watching = <bound method Helper.start_watching of Helper(tmp='/private/var/folders/sy/f16zz6x50xz3113nwtb9bvq00000gp/T/pytest-of-builder/pytest-4130/test_move_nested_subdirectorie0', emitters=[<FSEventsEmitter(Thread-35, started daemon 123145572818944)>], event_queue=<queue.Queue object at 0x10537ce80>)>

tests/test_emitter.py:513:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils.py:93: in expect_event
    event = self.event_queue.get(timeout=timeout)[0]
        expected_event = DirMovedEvent(src_path='/private/var/folders/sy/f16zz6x50xz3113nwtb9bvq00000gp/T/pytest-of-builder/pytest-4130/test_move_nested_subdirectorie0/dir1/dir2',
              dest_path='/private/var/folders/sy/f16zz6x50xz3113nwtb9bvq00000gp/T/pytest-of-builder/pytest-4130/test_move_nested_subdirectorie0/dir2',
              event_type='moved',
              is_directory=True,
              is_synthetic=False)
        self       = Helper(tmp='/private/var/folders/sy/f16zz6x50xz3113nwtb9bvq00000gp/T/pytest-of-builder/pytest-4130/test_move_nested_subdirectorie0',
       emitters=[<FSEventsEmitter(Thread-35, started daemon 123145572818944)>],
       event_queue=<queue.Queue object at 0x10537ce80>)
        timeout    = 2
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <queue.Queue object at 0x10537ce80>, block = True, timeout = 2

    def get(self, block=True, timeout=None):
        '''Remove and return an item from the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until an item is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Empty exception if no item was available within that time.
        Otherwise ('block' is false), return an item if one is immediately
        available, else raise the Empty exception ('timeout' is ignored
        in that case).
        '''
        with self.not_empty:
            if not block:
                if not self._qsize():
                    raise Empty
            elif timeout is None:
                while not self._qsize():
                    self.not_empty.wait()
            elif timeout < 0:
                raise ValueError("'timeout' must be a non-negative number")
            else:
                endtime = time() + timeout
                while not self._qsize():
                    remaining = endtime - time()
                    if remaining <= 0.0:
>                       raise Empty
E                       _queue.Empty

block      = True
endtime    = 22869232.09826587
remaining  = -0.007912501692771912
self       = <queue.Queue object at 0x10537ce80>
timeout    = 2

$PREFIX/lib/python3.10/queue.py:179: Empty

Environment:

attrs:           24.3.0-py310hecd8cb5_0
bzip2:           1.0.8-h6c40b1e_6
ca-certificates: 2024.12.31-hecd8cb5_0
coverage:        7.6.9-py310h46256e1_0
flaky:           3.7.0-py_0
iniconfig:       1.1.1-pyhd3eb1b0_0
libffi:          3.4.4-hecd8cb5_1
more-itertools:  10.3.0-py310hecd8cb5_0
ncurses:         6.4-hcec6c5f_0
openssl:         3.0.15-h46256e1_0
packaging:       24.2-py310hecd8cb5_0
pip:             25.0-py310hecd8cb5_0
pluggy:          0.13.1-py310hecd8cb5_0
py:              1.11.0-pyhd3eb1b0_0
pytest:          6.2.4-py310hecd8cb5_2
pytest-cov:      6.0.0-py310hecd8cb5_0
pytest-timeout:  2.2.0-py310hecd8cb5_0
python:          3.10.16-hce00570_1
pyyaml:          6.0.2-py310h46256e1_0
readline:        8.2-hca72f7f_0
setuptools:      75.8.0-py310hecd8cb5_0
sqlite:          3.45.3-h6c40b1e_0
tk:              8.6.14-h4d00af3_0
toml:            0.10.2-pyhd3eb1b0_0
tomli:           2.0.1-py310hecd8cb5_0
tzdata:          2025a-h04d1e81_0
watchdog:        4.0.1-py310h3333b6a_1  file:///var/folders/sy/f16zz6x50xz3113nwtb9bvq00000gp/T/abs_6fwdla7_zt/upload
wheel:           0.45.1-py310hecd8cb5_0
xz:              5.4.6-h6c40b1e_1
yaml:            0.2.5-haf1e3a3_0
zlib:            1.2.13-h4b97444_1

Tests failed only on osx-64 randomly. watchdog version 4.0.1 is used.
PR: AnacondaRecipes/watchdog-feedstock#10
@BoboTiG Please take a look. Thanks in advance.

@BoboTiG
Copy link
Collaborator

BoboTiG commented Feb 12, 2025

I would first try a more up-to-date version, if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants