Help us understand the problem. What is going on with this article?

Capybara利用時に発生した「sending SIGTERM to all processes」

現象

Capybaraを利用するジョブを作成し、画面でボタン押下時にそのジョブを呼び出そうとしていた。
railsコンソールからジョブを呼び出した時は正常に処理が終了するが、画面からボタン押下してジョブを呼び出した場合には、webページアクセス(Capybara::Session#visit)のタイミングで以下のようなエラーが発生し、処理が中断してしまう。

08:20:32             | exited with code 0
08:20:32 system      | sending SIGTERM to all processes
08:20:32 web.1       | terminated by SIGTERM
08:20:32 web.1       | terminated by SIGTERM
08:20:32 web.1       | terminated by SIGTERM
08:20:32 webpacker.1 | terminated by SIGTERM

ログがこれだけ。

環境

  • ruby 2.5.3
  • rails 5.2.3
  • Capybara 3.29.0

※ foremanを利用して、railsとwebpackerをdockerコンテナ上で起動している。

原因

foremanが、Capybara::Session#visitのタイミングで、同時起動するプロセスを全てkillしていた。

対応

foremanを利用する開発環境だけの事象ということがわかったため、Dockerfile上でforemanを利用しないように修正することで対応。

CMD ["bundle", "exec", "foreman", "start", "-f", "Procfile.dev"]

CMD ["bundle", "exec", "rails", "s", "-b", "0.0.0.0"]
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away