Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions spec/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def postgresql_explain
end

def mysql2_explain
seed_rows! # MySQL needs a bit of data to reach for indexes
seed_rows! if Delayed::Job.none? # MySQL needs a bit of data to reach for indexes
connection.execute("ANALYZE TABLE #{Delayed::Job.table_name}")
connection.execute("SET SESSION max_seeks_for_key = 1")
connection.execute("EXPLAIN FORMAT=TREE #{sql}").to_a.map(&:first).join("\n")
Expand All @@ -325,7 +325,7 @@ def sqlite3_explain

def seed_rows!
now = Delayed::Job.db_time_now
10.times do
100.times do
[true, false].repeated_combination(5).each_with_index do |(erroring, failed, locked, future), i|
Delayed::Job.create!(
run_at: now + (future ? i.minutes : -i.minutes),
Expand Down