Commit 3a4907ae authored by Wandenberg Peixoto's avatar Wandenberg Peixoto

changes to generate core dumps during tests if a segmentation fault happens

parent 782f14f6
......@@ -107,7 +107,7 @@ describe "Measure Memory" do
channel = 'ch_test_subscriber_system_size'
body = '1'
nginx_run_server(config.merge({:header_template => "H"}), :timeout => 15) do |conf|
nginx_run_server(config.merge({:header_template => "H", :master_process => 'off', :daemon => 'off'}), :timeout => 15) do |conf|
#warming up
EventMachine.run do
sub = EventMachine::HttpRequest.new(nginx_address + '/sub/' + channel.to_i.to_s).get :head => headers, :body => body
......
......@@ -2,8 +2,8 @@ module NginxConfiguration
def self.default_configuration
{
:disable_start_stop_server => false,
:master_process => 'off',
:daemon => 'off',
:master_process => 'on',
:daemon => 'on',
:content_type => 'text/html; charset=utf-8',
......@@ -68,7 +68,7 @@ master_process <%= master_process %>;
daemon <%= daemon %>;
worker_processes <%= nginx_workers %>;
worker_rlimit_core 500M;
working_directory <%= nginx_tests_tmp_dir %>;
working_directory <%= File.join(nginx_tests_tmp_dir, "cores", config_id) %>;
events {
worker_connections 1024;
......
......@@ -10,9 +10,21 @@ require 'nginx_configuration'
require 'custom_http_matchers'
RSpec.configure do |config|
config.before(:suite) do
FileUtils.rm_rf Dir[File.join(NginxTestHelper.nginx_tests_tmp_dir, "cores", "**")]
end
config.before(:each) do
core_dir = File.join(File.join(NginxTestHelper.nginx_tests_tmp_dir, "cores", config_id))
FileUtils.mkdir_p core_dir
Dir.chdir core_dir
end
config.after(:each) do
NginxTestHelper::Config.delete_config_and_log_files(config_id) if has_passed?
end
config.after(:suite) do
cores = Dir[File.join(NginxTestHelper.nginx_tests_tmp_dir, "cores", "**", "core")]
raise StandardError.new "\n\nCore dump(s) at:\n#{cores.join("\n")}\n\n" unless cores.empty?
end
config.order = "random"
config.include(CustomHttpMatchers)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment