I have a branch that tries to upgrade to 2.7.0 but we are getting sporadic test failures of "can't modify frozen Time" that look like this:
# Braze's code Failure/Error: date = Time.now.utc.at_midnight() RuntimeError: can't modify frozen Time
It's sporadic but only happens when we have a stubbing out of Time.now, like
let!(:now) {Time.now}
before :each do
allow(Time).to receive(:now).and_return(now)
end
I think it comes from this commit which does a `Time.now.freeze`. Is it possible to dup the time?
https://github.com/mongodb/mongo-ruby-driver/commit/80f369b35c30e15219f73c8796a3bc6522aa9f1f
- is related to
-
RUBY-2679 Stop duplicating Time instances
- Closed
- links to