Skip to content

Commit

Permalink
Handle path exhaustion
Browse files Browse the repository at this point in the history
  • Loading branch information
pschanely committed Feb 25, 2024
1 parent d1a22ab commit c782228
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hypothesis_crosshair_provider/crosshair_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ def hacky_patchable_run_context_yielding_per_test_case_context():

@contextmanager
def single_execution_context() -> Any:
nonlocal search_root
if search_root.child.is_exhausted():
debug("Resetting search root")
# might be nice to signal that we're done somehow.
# But for now, just start over!
search_root = RootNode()
global _PREVIOUS_REALIZED_DRAWS
_PREVIOUS_REALIZED_DRAWS = None
iter_start = monotonic()
Expand Down Expand Up @@ -67,6 +73,11 @@ def single_execution_context() -> Any:
id(symbolic): deep_realize(symbolic)
for symbolic in space._hypothesis_draws
}
else:
# TODO: I can't detach_path here because it will conflict with the
# top node of a prior "real" execution.
# Should I just generate a dummy concrete value for each of the draws?
_PREVIOUS_REALIZED_DRAWS = {}
debug("end iter (normal)")
except Exception as exc:
try:
Expand Down

0 comments on commit c782228

Please sign in to comment.