-
Notifications
You must be signed in to change notification settings - Fork 586
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
Serialize global random generator initialization when invoking hypothesis under concurrent loads #4094
base: master
Are you sure you want to change the base?
Conversation
Thanks for your contribution @andfoy! While protecting the initialization fixes the crash, I think there is still a race on seed-restore that will make the random generator non-deterministic in this case - which will lead to more subtle failures. I think making |
...hm, the seeder also manages e.g. Maybe avoiding the crash is enough, possibly adding a warning somewhere in the docs that threaded runs are known to cause non-deterministic PRNG. I'll defer to @Zac-HD when he's back. |
|
I don't think we should make Which in turn has some non-trivial interaction with the newly-threadlocal hypothesis global prng state that I'd have to think through... |
See #4028 (comment)
This PR adds a lock around the initialization of the Hypothesis global random generator, this prevents issues such as #4028 (comment) from occurring under free-threaded Python.