Skip to content
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

Drop microseconds in job argument assertions #35713



Copy link

@gmcgibbon gmcgibbon commented Mar 22, 2019


When serializing arguments for Active Jobs, Time, DateTime, and ActiveSupport::TimeInZone all lose a certain degree of precision eg. now =; Time.iso8601(now.iso8601) == now. We can fix this by adding precision (now =; Time.iso8601(now.iso8601(20)) == now), but that adds unnecessary size to job payloads. Instead, I've opted to modify the test helper to drop microseconds (and nanoseconds) from passed in time job arguments.

@rails-bot rails-bot bot added the activejob label Mar 22, 2019
Copy link

@rafaelfranca rafaelfranca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


@gmcgibbon gmcgibbon force-pushed the drop_nsec_in_job_argument_assertions branch from 1ab3e27 to 7f03862 Compare March 22, 2019 21:05
@gmcgibbon gmcgibbon merged commit 5672396 into rails:master Mar 22, 2019
@gmcgibbon gmcgibbon deleted the drop_nsec_in_job_argument_assertions branch March 22, 2019 21:39
Copy link

kaspth commented Mar 24, 2019

Should we mention this in the guides too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants