flyingmutant / rapid

Rapid is a modern Go property-based testing library
https://pkg.go.dev/pgregory.net/rapid
Mozilla Public License 2.0
579 stars 25 forks source link

panic in checkFailFile if code has been changed #63

Open jbricht opened 8 months ago

jbricht commented 8 months ago

Hi, thanks for the great library :)

I just encountered a very confusing panic, the "overrun" panic from drawBits. After grepping through the library a bit, i realized it was panicking while trying to replay some kind of past test failure. Deleting all the files in testdata made the panic go away.

I had just changed my code to draw more often, so I guess it was trying to run the new code on the old fail file and running out of recorded rng output?

Not sure of the best way to handle this situation, but a more helpful error message would be fantastic, if you have the time!

Again, thank you for the wonderful library.

flyingmutant commented 8 months ago

Hi, thanks a lot for reporting! overrun panic is an internal way to signal not enough data, it should not lead to a test failure and the only way you can observe it should be if you are running under a debugger and breaking on all the panics.

If the overrun is user-visible or does result in a test failure, does it happen with the latest version of rapid? If so, can you provide a small reproducer for the problem? That would help a lot.