-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time.freeze doesn't seem to freeze time #146
Comments
I am experiencing the same on Arch, although my timezone doesn't change like yours do. On OS X Yosemite everything is working fine. |
Here is the error I am getting:
|
Hang on! This looks like it might be a difference in the database setup or something. Notice how the actual timestamps are less accurate than what is expected? The same happens in your example, @davidpdrsn. The timestamps are probably persisted with less precision in our Arch installations or something. |
Yeah, that's it. Looking at the issue you referenced earlier, @davidpdrsn, this was mentioned in #97 (comment). |
The db configuration can effect the percision of timestamps. See this: travisjeffery/timecop#146 . Works locally of course because of local db setup, CI it failed, so this just truncates at the millisecond.
It seems like db config can timestamp precision, so I'm amending the test to expect `consented_at` to be withih a second. It could probably be set to be within a milisecond (since the variance I've observed is much smaller) but I'm keeping it simple and permissive. Variance observed in CI: - expected: 2018-04-26 17:37:07.235862273 +0000 - got: 2018-04-26 17:37:07.235862000 +0000 See travisjeffery/timecop#146
It seems like db config can timestamp precision, so I'm amending the test to expect `consented_at` to be withih a second. It could probably be set to be within a milisecond (since the variance I've observed is much smaller) but I'm keeping it simple and permissive. Variance observed in CI: - expected: 2018-04-26 17:37:07.235862273 +0000 - got: 2018-04-26 17:37:07.235862000 +0000 See travisjeffery/timecop#146
I'm having some issues with
Timecop.freeze
. It works fine on OS X, but the same test fails on Arch Linux. Not sure if this is because of Timecop or rspec.I've an example app with a failing test
https://github.com/davidpdrsn/timecop-test-failure
User spec
User model
Test output
Might be related to #97, but as I said it works on OS X, but not Arch Linux.
The text was updated successfully, but these errors were encountered: