i often want to change my filesystem while running...
# general
g
i often want to change my filesystem while running pytest, but I get `Filesystem changed during run: retrying
Test
in 500ms...` . I’m pretty confident my changes shouldn’t affect the test (And that in this case I’m not even changing any transitive dependencies of the test). is there a flag I can pass to
pants test
to ignore filesystem changes during run?
l
Yes there is
--no-watch-filesystem
. With that you will need
--no-pantsd
too, because
--no-watch-filesystem
requires it.
c
As @lemon-oxygen-72498 says there’s a big hammer. If you find you still want to file watching for relevant sources, you may look at the
.pants.d/pants.log
file to find out which file was causing the restart and add that to pants ignore paths (or your
.gitignore
if you’ve not told pants to not use that file and you also don’t want it in git): https://www.pantsbuild.org/docs/reference-global#pants_ignore
w
To echo Andreas, turning off the Pants daemon is always possible, but it comes with a perf hit that you might not want. The
pants_ignore
or
.gitignore
are more performant options, assuming what you want to do is globbable and can safely be ignored. The other question is, are you changing source files during these test runs/
Vs like... Readme files
f
You could also make a copy of whatever files you need and change them in the sandbox that the test is run in. What files are you changing anyways during your test runs?
w
assuming that the files are not something that you wanted to have gitignore’d, this likely has something to do with https://github.com/pantsbuild/pants/issues/10705 … sorry for the trouble!
i’ll make sure to include that issue in the prioritization surveying we’re doing now.
c
Is there are way to have pants ignore readme files or maybe a docs folder? Specially for goals like
generate-lockfiles
or testing? I like to update docs while waiting for things but that causes pants to restart. Very frustrating!😐
c
👍 1