Fix random CI fail due to auto-updating timestamp

Example failure: https://buildkite.com/rails/rails/builds/68074#0fe7ca54-fcce-4a47-85db-a784275c8f51/1115-1125

Each time a job is serialized, `enqueued_at` is updated.  Thus, separate
serializations of the same job can have different `enqueued_at`
timestamps if the serializations do not occur within the same second.
This commit is contained in:
Jonathan Hefner 2020-04-06 23:31:29 -05:00
parent 834f5414c3
commit 056b252010
1 changed files with 3 additions and 0 deletions

View File

@ -22,6 +22,9 @@ class JobSerializationTest < ActiveSupport::TestCase
end
test "serialize and deserialize are symmetric" do
# Ensure `enqueued_at` does not change between serializations
freeze_time
# Round trip a job in memory only
h1 = HelloJob.new("Rafael")
h2 = HelloJob.deserialize(h1.serialize)