-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix wrong fixture behavior due to cached fixtures and conftest not being watched #67
Conversation
wip debug fixtures persisting between runs
tests passing
Add fixture monkeypatch Track fixture names and use that instead of looking at codestring Pass in autowatch option based on client Update docs
Use watchman for metatests to try to improve consistency
Randomly reproducing the CI issues so there appears to be more to it |
Running in a dev container, it usually passes Running in the CI it seems to always fail Adding delays and retries not mitigating issue on CI. Adding delays seemed to help on dev container but maybe it didn't. Retries not helping seems to imply that if its a race condition, things are getting "cemented". Odd that jurigged acknowledges changes, test run indicates that its not using a cached session, but seeing the error when things were cached. |
Github CI must be using a cached network mount that results in signals working but stale file read data. Moving to temp directory (which won't use mount and should have predictable IO), which I contemplating doing originally, seems to have fixed the CI issue. It's not clear to me why errors showed the updated version of the function but even with excessive delays the hot reloader was still loading in a stale version. |
Related to #16 because this adds the env variable |
This addresses #65
There are a couple issues around fixtures that this addresses.
The fixture logic and dependencies not updating were observed as occurring due to conftest files not being watched. The automatic file watching applied to tests but not the conftest files used by tests. This adds automatic watching of conftest files, which can be disabled with
PYTEST_DAEMON_DO_NOT_AUTOWATCH_FIXTURES
/--daemon-do-not-autowatch-fixtures
The other issue was that the session caching was resulting in stale fixture references in test functions. This adds logic to clear the session cache if jurigged updates the signature of a test function.
Adds env variable -
PYTEST_DAEMON_USE_WATCHMAN
which determines whether to use watchman or polling for filesystem updates.