-
Notifications
You must be signed in to change notification settings - Fork 105
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
Wanted: Some way to reproduce results #116
Comments
Well, I guess it needs both seed and size. And I just found |
Verbose output seems the best place to put that when people ask for it. |
My concern is that if it doesn't show me the seed when it fails, if it's a rare failure it's already too late to go back and request verbose output. For example, in the failure I had that prompted this ticket, I still haven't reproduce it. I'm about to bump up |
If you convert it to an existential, SwiftCheck will bombard it for you trying to search for a passing value. |
I admit to not really being sure how to do that. I found the |
Ah, I remember why I didn't let you see this (even though SwiftCheck does keep track of it). The
Yeah. #43 Shows the identities for that stuff (if you'll excuse the notation).
If that were the case, your log should contain |
Yeah it did:
This was after printing 500 copies of
|
Interesting. Seems I wasn't treating them like discards after all. |
OK, so this still leaves you with the problem of how to reproduce a test case. I feel it's particularly inelegant to ask you to manually invoke some future |
I feel like the most important thing I need is just the info necessary to deterministically re-run the tests (which presumably is just the initial seed and size; I haven't checked but I hope the RNG you're using is deterministic and local to the library, so if there's other threads running they can't interfere). Once I have the seed and size, I can look into trying to replay it with a checker argument. But without knowing the seed/size, there's no way to replay. And if the failure is rare, then I can't just re-run it and hope to see the problem again. I'm thinking this just needs to print the seed/size on a failure. No need to print anything different when things pass. After all, there's no benefit in replaying a successful check. |
Lucky for you, it is neither of those things. At the time the little Random module in here was written, I was feeling neither confident in my ability to, nor ready to present, an implementation of a Mersenne twister or somesuch other feat of entropy-generating prowess. Nor was I willing to link with OpenSSL to accomplish the same. All this to say we use After that is done, then the seed and RNG can be handed back to you in a useful manner. |
The thing about printing them to the console is that you need both seed and |
I just had a test failure (where I couldn't see the counterexample, see #115), but I can't reproduce it. It would be great if test failures would print the seed and if there was a trivial way of plugging that seed back into the test to reproduce that case.
The text was updated successfully, but these errors were encountered: