Skip to content

Commit 38f9e6c

Browse files
committed
Make sure tmp/pids exists before running Puma test
And that all processes have properly terminated and everything is cleaned up.
1 parent 90ea2b7 commit 38f9e6c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/integration/puma/plugin_test.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ class PumaPluginTest < ActiveSupport::TestCase
55
self.use_transactional_tests = false
66

77
setup do
8+
FileUtils.mkdir_p Rails.root.join("tmp", "pids")
9+
810
cmd = %w[
911
bundle exec puma
1012
-b tcp://127.0.0.1:9222
@@ -22,7 +24,10 @@ class PumaPluginTest < ActiveSupport::TestCase
2224
end
2325

2426
teardown do
25-
Process.kill :INT, @pid
27+
terminate_process(@pid, signal: :INT)
28+
wait_for_registered_processes 0, timeout: 0.2.second
29+
30+
JobResult.delete_all
2631
end
2732

2833
test "perform jobs inside puma's process" do

0 commit comments

Comments
 (0)