Git Product home page Git Product logo

Comments (8)

joeyespo avatar joeyespo commented on August 11, 2024 2

FYI Released pytest-watch 3.0.0 today, which includes --poll.

Be sure to pip install --upgrade pytest-watch 😃

from pytest-watch.

joeyespo avatar joeyespo commented on August 11, 2024

Hi, @carsongee. Perhaps.

Actually, do you think this is a watchdog bug? If the files are indeed changing, watchdog should pick it up regardless if it's running in a container or not. Or am I misunderstanding?

from pytest-watch.

carsongee avatar carsongee commented on August 11, 2024

I just checked their repo, and found a very similar issue: gorakhargosh/watchdog#283. So it isn't really designed to handle events on remote file systems like we have with mounted container volumes since it is just using kernel events, so if you run watchdog in the container, since the kernel in the container isn't firing the event, the one in the host OS is, the watchdog can't react to it.

from pytest-watch.

joeyespo avatar joeyespo commented on August 11, 2024

Good find!

Looks like watchdog provides a decent workaround with PollingObserver.

It'd be great it watchdog was able to detect whether inotify was reliable or not, so you wouldn't need an application-level concern. This is, in my opinion, a leaky abstraction that watchdog could potentially plug up. (Interested in opening a new issue asking for them to look into this? Docker is indeed growing in popularity.)

We could look at other libraries to see if they work inside of Docker out-of-the-box so pytest-watch users don't have to waste any time with this surprise. In the short-term, adding an option to use polling should be ok. I'd happily pull in a PR if you wanted to add a --poll option.

from pytest-watch.

carsongee avatar carsongee commented on August 11, 2024

I added the PR. As to reporting it upstream, are you thinking the issue would be to have the standard observer figure out if it needs to use polling? That would be pretty cool. I don't think there is any other way to address it in watchdog since the nature of remote filesystems is not to generate kernel events, that would have to be a fix in Mac and Linux kernels I think, but I'm a little out of my depth on this.

from pytest-watch.

joeyespo avatar joeyespo commented on August 11, 2024

are you thinking the issue would be to have the standard observer figure out if it needs to use polling

Exactly. Then all tools that use watchdog would just work under this scenario instead of having to implement their own custom solutions.

I believe it's possible. For instance, one (bad) way would be to have watchdog create a .watchdog file and delete it right away in the directory it's observing. If no kernel events happen, turn on polling.

from pytest-watch.

carsongee avatar carsongee commented on August 11, 2024

gorakhargosh/watchdog#316

from pytest-watch.

joeyespo avatar joeyespo commented on August 11, 2024

@carsongee Thank you!

from pytest-watch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.