Issue Task Resolved

#110665Optimize password hashing in unit tests

Wouter Wolters 09/09/26, 17:28 updated 09/22/26, 20:00

Description

Several unit tests perform production-cost Argon2 hashing even though they
test how callers interact with the password hashing API rather than the
hashing implementation itself.

Mock the password hash factory and hash implementation in tests for:

- AuthenticationService
- DataHandler
- SaveToDatabaseFinisher

The dedicated Argon2i and Argon2id tests should retain one production-cost
hash generation per algorithm. Independent password verification tests can
use low-cost Argon2 hashes, while rehash checks can use fixed hashes with the
required metadata.

The affected tests improve from approximately 7.28 seconds to 0.35 seconds
while retaining the same behavioral coverage. Production code remains
unchanged.

Reviews 2

History 14

  1. Wouter Wolters commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-22T20:00:13+00:00" > 09/22/26, 20:00 </span>

    Applied in changeset commit:495339a956aa07686f679a31ddd24eca92166b63.