-
Notifications
You must be signed in to change notification settings - Fork 54
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
Added feature to poll files for help with virtual machines/docker #9
Comments
Hi, @carsongee. Perhaps. Actually, do you think this is a |
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. |
Good find! Looks like watchdog provides a decent workaround with It'd be great it watchdog was able to detect whether 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 |
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. |
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 |
@carsongee Thank you! |
FYI Released pytest-watch 3.0.0 today, which includes Be sure to |
We do a lot of our development in docker, and the events for changed files are generated in the host OS instead of inside docker, so ptw doesn't see that files have changed. Do you have any interest in adding a polling option, that will just scan the folder for modified file times and trigger tests? I may be able to write the code if you are.
The text was updated successfully, but these errors were encountered: