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

Avoid weakref nondeterminism #313

Open
pschanely opened this issue Oct 5, 2024 · 1 comment
Open

Avoid weakref nondeterminism #313

pschanely opened this issue Oct 5, 2024 · 1 comment

Comments

@pschanely
Copy link
Owner

pschanely commented Oct 5, 2024

Weak references are inherently non-deterministic. CrossHair right now does nothing special to address this, and so it'll likely raise NotDeterministic when executing such code.

This issue (or maybe just a related one) is visible right now as a hypothesis test failure at tests/cover/test_filter_rewriting.py::test_regex_filter_rewriting. (via an unstable iteration order while trying to intercept a dictionary access for LAMBDA_SOURCE_CACHE in src/hypothesis/internal/reflection.py. Note that this is a global.

Probably the (easiest?) path forward is to intercept all weak accesses and make all values appear to be missing. Though then we'll miss bugs where returning a prior result reveals an issue. These paths should be marked incomplete, and should be subject to re-execution per #309.

@pschanely
Copy link
Owner Author

As of 0.0.74, there is (incomplete) support for making weakrefs be universally missing. You can check these weakref tests for up-to-date information on our level of support.

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

1 participant