diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-04-13 11:46:14 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-04-13 12:01:20 -0700 |
commit | f34618e64b254f7792b476acf2e7eb426aa551a2 (patch) | |
tree | 4d3e6ee0358e53667f1b512cb930afe4cd9d5911 /test | |
parent | a9d022298c194edf296d6d19ff97c8b8a6ce4839 (diff) | |
download | unicorn-f34618e64b254f7792b476acf2e7eb426aa551a2.tar.gz |
Instead of just worker.nr. This is a configuration file/API change and will break existing configurations. This allows worker.tempfile to be exposed to the hooks so ownership changes can still happen on it. On the other hand, I don't know of many people actually using this feature (or Unicorn).
Diffstat (limited to 'test')
-rw-r--r-- | test/exec/test_exec.rb | 6 | ||||
-rw-r--r-- | test/unit/test_signals.rb | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb index 67a189c..596ab88 100644 --- a/test/exec/test_exec.rb +++ b/test/exec/test_exec.rb @@ -39,8 +39,8 @@ end worker_processes 4 timeout 30 logger Logger.new('#{COMMON_TMP.path}') -before_fork do |server, worker_nr| - server.logger.info "before_fork: worker=\#{worker_nr}" +before_fork do |server, worker| + server.logger.info "before_fork: worker=\#{worker.nr}" end EOS @@ -286,7 +286,7 @@ end File.unlink(tmp.path) ucfg = Tempfile.new('unicorn_test_config') ucfg.syswrite("listen '#@addr:#@port'\n") - ucfg.syswrite("before_fork { |s,nr|\n") + ucfg.syswrite("before_fork { |s,w|\n") ucfg.syswrite(" s.listen('#{tmp.path}', :backlog => 5, :sndbuf => 8192)\n") ucfg.syswrite(" s.listen('#@addr:#{port2}', :rcvbuf => 8192)\n") ucfg.syswrite("\n}\n") diff --git a/test/unit/test_signals.rb b/test/unit/test_signals.rb index 45de263..bedce01 100644 --- a/test/unit/test_signals.rb +++ b/test/unit/test_signals.rb @@ -30,7 +30,7 @@ class SignalsTest < Test::Unit::TestCase tmp.chmod(0) @server_opts = { :listeners => [ "127.0.0.1:#@port", @tmp.path ], - :after_fork => lambda { |server,worker_nr| + :after_fork => lambda { |server,worker| trap(:HUP) { tmp.chmod(n += 1) } }, } |