[openstreetmap/openstreetmap-website] Reduce test run time, current improvement: 9.5m to 4.9m (PR #4708)
Josh Thompson
notifications at github.com
Thu Apr 18 15:22:46 UTC 2024
> Password hash creation is deliberately slow, to make brute forcing hard
absolutely. In a production environment, we'd want to do the slow and laborious hash creation, but for testing, we don't.
So, I hard-coded a generated hash (for the tests/factory data), so when setting up 4000 test users, the deliberately slow function is never called, and it saved a ton of time:
https://github.com/openstreetmap/openstreetmap-website/pull/4708/files#diff-3cb894babbd387f02bde8eb4daf7ddb6f0a5207d0562af589dc59a5653092c04R5
I'm still optimistic about a 90% improvement in test run time - I'm aiming for ~1.5 minutes, total. I don't know if I'll get there, but we're trying! :)
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4708#issuecomment-2064213359
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4708/c2064213359 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240418/fdf43b7a/attachment.htm>
More information about the rails-dev
mailing list