Sha256: 73ce949c91e11d42b6217dcd08a5027373f1e1d54ce30188d2e89b0f85b36afd
Contents?: true
Size: 726 Bytes
Versions: 10
Compression:
Stored size: 726 Bytes
Contents
# frozen_string_literal: true require 'test_helper' module Shipit class UniqueJobTest < ActiveSupport::TestCase test "the lock key contains the job type" do task = shipit_tasks(:shipit_restart) job_a = ChunkRollupJob.new(task) job_b = GithubSyncJob.new(task) called = false job_a.acquire_lock do job_b.acquire_lock do called = true end end assert called end test "the lock key is serialized" do task = shipit_tasks(:shipit_restart) job = ChunkRollupJob.new(task) key = %(Shipit::ChunkRollupJob-{"_aj_globalid"=>"gid://shipit/Shipit::Task/#{task.id}"}) assert_equal key, job.lock_key(*job.arguments) end end end
Version data entries
10 entries across 10 versions & 1 rubygems