Welcome to mirror list, hosted at ThFree Co, Russian Federation.

utils.rb « support « tests « sidekiq-reliable-fetch « gems « vendor - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c481c6dad8048685d734cdb2770497302db4a5dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
def assert(text, actual, expected)
  if actual == expected
    puts "#{text}: #{actual} (Success)"
  else
    puts "#{text}: #{actual} (Failed). Expected: #{expected}"
    exit 1
  end
end

def spawn_workers(number)
  pids = []

  number.times do
    pids << spawn('sidekiq -q default -q high -q low -r ./config.rb')
  end

  pids
end

# Stop Sidekiq workers
def stop_workers(pids)
  pids.each do |pid|
    Process.kill('KILL', pid)
    Process.wait pid
  end
end