For some reason Issue#lazy_majority_passed? was super flaky. It was
returning true or false seemingly at random. When I put in a
debugger, I got similar results when doing the date/time comparison
repeatedly:
I poked around with different options, converting to UTC and so forth,
but the same issue presented itself. There's more than 24 hours between
the values, so time zones shouldn't be an issue anyway. I settled on
converting to string, which I feel pretty confident works as expected.
The tests passed consistently over several runs, at any rate.
I suspect this is an obscure bug in ActiveSupport, but didn't feel it
was worth too deep an investigation, because, fingers crossed, this
issue will hopefully have been resolved in a more recent version of
Ruby/Rails.
I needed to convert updated_at.to_datetime because
updated_at.to_s(:iso8601) returns a string in a different format that
is not lexically sortable. It starts with the day of the week, Sat,
Sun, etc.
For some reason
Issue#lazy_majority_passed?
was super flaky. It was returningtrue
orfalse
seemingly at random. When I put in a debugger, I got similar results when doing the date/time comparison repeatedly:I poked around with different options, converting to UTC and so forth, but the same issue presented itself. There's more than 24 hours between the values, so time zones shouldn't be an issue anyway. I settled on converting to string, which I feel pretty confident works as expected. The tests passed consistently over several runs, at any rate.
I suspect this is an obscure bug in
ActiveSupport
, but didn't feel it was worth too deep an investigation, because, fingers crossed, this issue will hopefully have been resolved in a more recent version of Ruby/Rails.I needed to convert
updated_at.to_datetime
becauseupdated_at.to_s(:iso8601)
returns a string in a different format that is not lexically sortable. It starts with the day of the week,Sat
,Sun
, etc.