Skip to content

Avoid weakref nondeterminism #313

Open
@pschanely

Description

@pschanely

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions