Skip to content

Lower bcrypt cost in tests to speed up the suite - #27

Merged
kcdragon merged 1 commit into
mainfrom
bcrypt-min-cost-test-speed
Jun 11, 2026
Merged

kcdragon merged 1 commit into
mainfrom
bcrypt-min-cost-test-speed

Conversation

@kcdragon

Copy link
Copy Markdown
Collaborator

Sets BCrypt::Engine.cost to the minimum in test_helper.rb so the users fixture and has_secure_password digests (registration and password-reset specs) stop hashing at the default cost of 12. Each cost-12 hash burns ~0.5s of CPU on this hardware, so this roughly halves the suite's CPU time and speeds up password-touching specs — a benefit that grows on single-core CI runners and as the suite grows. Production hashing is unaffected since the change is test-env only.

🤖 Generated with Claude Code

Set BCrypt::Engine.cost to the minimum in test_helper so fixtures and
has_secure_password digests stop hashing at the default cost (12). This
roughly halves the suite's CPU time and speeds up password-touching specs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kcdragon
kcdragon merged commit 67c83d0 into main Jun 11, 2026
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

Successfully merging this pull request may close these issues.

1 participant