Skip to content

Commit

Permalink
Fix potential db lock in media tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aidewoode committed Jan 17, 2024
1 parent f41d96b commit 127026f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/models/media_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@

class MediaTest < ActiveSupport::TestCase
include ActionCable::TestHelper
include ActiveJob::TestHelper

setup do
clear_media_data
Media.sync_all

# Because Media.sync_all will cause others background jobs to be enqueued,
# we need to make sure all background jobs are performed.
perform_enqueued_jobs do
Media.sync_all
end
end

test "should create all records in database when synced" do
Expand Down

0 comments on commit 127026f

Please sign in to comment.