diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2019-06-06 14:34:01 +0200 |
---|---|---|
committer | Jan Provaznik <jprovaznik@gitlab.com> | 2019-06-07 11:07:47 +0200 |
commit | 941281809fe9994b2a02e13fbb0815e11f83c9e6 (patch) | |
tree | bc478b7e4bc997cf456f131b2d0f767e716da1cb | |
parent | 395523ecc20c292eb8ffd1520625a4727a25e652 (diff) | |
download | gitlab-ce-puma-mem-counter.tar.gz |
Disable PumaWorkerKiller when testing workerspuma-mem-counter
Specs in `spec/rack_servers/puma_spec.rb` test spawning/signalling
of Puma workers - we don't need PumaWorkerKiller in this case.
Also during the test we load only a basic rack application, and
the observer depends on Gitlab::Metrics -> we would have to load
many dependencies to make these available (or mock this class).
-rw-r--r-- | config/puma.example.development.rb | 1 | ||||
-rw-r--r-- | spec/rack_servers/puma_spec.rb | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/config/puma.example.development.rb b/config/puma.example.development.rb index 490c940077a..9df24bf74e3 100644 --- a/config/puma.example.development.rb +++ b/config/puma.example.development.rb @@ -42,7 +42,6 @@ bind 'unix:///home/git/gitlab.socket' workers 2 require_relative "/home/git/gitlab/lib/gitlab/cluster/lifecycle_events" -require_relative "/home/git/gitlab/lib/gitlab/cluster/puma_worker_killer_initializer" on_restart do # Signal application hooks that we're about to restart diff --git a/spec/rack_servers/puma_spec.rb b/spec/rack_servers/puma_spec.rb index 8290473821c..a4b37905af3 100644 --- a/spec/rack_servers/puma_spec.rb +++ b/spec/rack_servers/puma_spec.rb @@ -20,7 +20,7 @@ describe 'Puma' do File.write(config_path, config_lines) cmd = %W[puma -e test -C #{config_path} #{File.join(__dir__, 'configs/config.ru')}] - @puma_master_pid = spawn(*cmd) + @puma_master_pid = spawn({ 'DISABLE_PUMA_WORKER_KILLER' => '1' }, *cmd) wait_puma_boot!(@puma_master_pid, File.join(project_root, 'tmp/tests/puma-worker-ready')) WebMock.allow_net_connect! end |