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

Fast replay without needing to serialize the value #441

Open
vlovich opened this issue Apr 6, 2024 · 0 comments
Open

Fast replay without needing to serialize the value #441

vlovich opened this issue Apr 6, 2024 · 0 comments

Comments

@vlovich
Copy link

vlovich commented Apr 6, 2024

On a failure, it would be nice if proptest printed a string that could be used to more immediately replay exactly the failing test (i.e. on the very first try).

For example, the JS fast-check library will print something like:

{ seed: -1819918769, path: "0:...:3", endOnFailure: true }

You can then either paste that into the code or set an environment variable so that the very next run of the test is the same as the one that caused the problem.

I know the note about serializing vs picking the seed, but I feel like fast-check picks a middle where it saves the set of operations to perform against the seed to reach the relevant test (i.e. you still evaluate all the strategies, but you skip invoking the test case until you reach the appropriate nth invocation). Additionally, if your RNG supports it (e.g. PCG) & you know that you're going to discard the value anyway, you could skip generating any actual data & just move the RNG state forward "as-if" you had actually generated the relevant value for the strategy.

@vlovich vlovich changed the title Fast replay Fast replay without needing to serialize the value Apr 6, 2024
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