Skip to content

Payload assert : nondeterministic error with timestamps #3

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

Open
Startouf opened this issue Jun 16, 2017 · 1 comment
Open

Payload assert : nondeterministic error with timestamps #3

Startouf opened this issue Jun 16, 2017 · 1 comment

Comments

@Startouf
Copy link

Startouf commented Jun 16, 2017

DateTime objects are not always converted to the same string in the payload, there is a 1/1000sec difference which causes nondeterministic errors when validating timestamps

Example

Expected JSON payload to have key 'ends_at' == 
"2017-07-16T11:55:12.241+02:00" 
but was 
"2017-07-16T11:55:12.242+02:00"

This failure happens roughly 1/2 of the time, might be a rounding problem.

FYI I am running on

  • Ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin15]
  • rails-5.0.2
@Startouf
Copy link
Author

Startouf commented Jul 17, 2017

As discussed in Slack, this seems to be related to Ruby's DateTime implementation.
When using Mongoid's type: Time in the models the error is gone.

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

No branches or pull requests

1 participant