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:
parent
834f5414c3
commit
056b252010
|
@ -22,6 +22,9 @@ class JobSerializationTest < ActiveSupport::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
test "serialize and deserialize are symmetric" do
|
test "serialize and deserialize are symmetric" do
|
||||||
|
# Ensure `enqueued_at` does not change between serializations
|
||||||
|
freeze_time
|
||||||
|
|
||||||
# Round trip a job in memory only
|
# Round trip a job in memory only
|
||||||
h1 = HelloJob.new("Rafael")
|
h1 = HelloJob.new("Rafael")
|
||||||
h2 = HelloJob.deserialize(h1.serialize)
|
h2 = HelloJob.deserialize(h1.serialize)
|
||||||
|
|
Loading…
Reference in New Issue