Skip to content

Conversation

@tenderlove
Copy link
Collaborator

We have a test that tries to test the "calibration" function in BCrypt. This function is supposed to return a "cost" based on some number of milliseconds passed in. We're trying to make the cost relative to some beginning cost (MIN_COST + 1), time that, then use it as the "relative time". The problem is that the time this takes in CI is not constant, so even min_time_ms * 4 may fit inside the same "cost" as the original.

I'm bumping the factor to 5 to hopefully reduce the flakiness. It seems like we just want to test that "some time deadline" returns a greater cos than a different time deadline, so I think bumping the factor to 5 is a legit fix

We have a test that tries to test the "calibration" function in BCrypt.
This function is supposed to return a "cost" based on some number of
milliseconds passed in.  We're trying to make the cost relative to some
beginning cost (MIN_COST + 1), time that, then use it as the "relative
time".  The problem is that the time this takes in CI is not constant,
so even `min_time_ms * 4` may fit inside the same "cost" as the
original.

I'm bumping the factor to `5` to hopefully reduce the flakiness. It
seems like we just want to test that "some time deadline" returns a
greater cost than a different time deadline, so I think bumping the
factor to 5 is a legit fix
@tenderlove tenderlove merged commit ca9cea1 into bcrypt-ruby:master Dec 31, 2025
24 checks passed
@tenderlove tenderlove deleted the deal-with-flake branch December 31, 2025 18:46
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