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

Merged

Conversation

gmcgibbon
Copy link
Member

@gmcgibbon gmcgibbon commented Mar 22, 2019

Summary

When serializing arguments for Active Jobs, Time, DateTime, and ActiveSupport::TimeInZone all lose a certain degree of precision eg. now = Time.now; Time.iso8601(now.iso8601) == now. We can fix this by adding precision (now = Time.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
Member

@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.

:shipit:

@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
@kaspth
Copy link
Contributor

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants