frsyuki/serverengine — pull request #6 by sonots (2013-09-08 06:19:47+00:00)
Title: fix NameError in test

I've noticed that all test fails because of NameError.

Still, many test fails (I use ruby-2.0.0-p195), though.

1) ServerEngine::Daemon run and graceful stop
Failure/Error: test_state(:server_stop_graceful).should == 1
expected: 1
got: 0 (using ==)
# ./spec/daemon_spec.rb:18:in `block (2 levels) in '

2) ServerEngine::Daemon signals
Failure/Error: test_state(:server_reload).should == 1
expected: 1
got: 0 (using ==)
# ./spec/daemon_spec.rb:32:in `block (2 levels) in '

3) ServerEngine::MultiWorkerServer scale up
Failure/Error: test_state(:worker_run).should == 3
expected: 3
got: 5 (using ==)
# ./spec/multi_process_server_spec.rb:22:in `block (3 levels) in '

4) ServerEngine::MultiWorkerServer scale down
Failure/Error: test_state(:worker_stop).should == 2
expected: 2
got: 0 (using ==)
# ./spec/multi_process_server_spec.rb:50:in `block (3 levels) in '

5) ServerEngine::SignalThread call handler
Failure/Error: n.should == 1
ThreadError:
can't be called from trap context
# ./lib/serverengine/signal_thread.rb:138:in `unlock'
# ./lib/serverengine/signal_thread.rb:138:in `ensure in enqueue'
# ./lib/serverengine/signal_thread.rb:138:in `enqueue'
# ./lib/serverengine/signal_thread.rb:46:in `block in trap'
# ./spec/signal_thread_spec.rb:21:in `block (2 levels) in '

[50/1873]
6) ServerEngine::SignalThread signal in handler
Failure/Error: sleep 1
ThreadError:
can't be called from trap context
# ./lib/serverengine/signal_thread.rb:138:in `unlock'
# ./lib/serverengine/signal_thread.rb:138:in `ensure in enqueue'
# ./lib/serverengine/signal_thread.rb:138:in `enqueue'
# ./lib/serverengine/signal_thread.rb:46:in `block in trap'
# ./spec/signal_thread_spec.rb:48:in `call'
# ./spec/signal_thread_spec.rb:48:in `sleep'
# ./spec/signal_thread_spec.rb:48:in `block (2 levels) in '

7) ServerEngine::SignalThread stop in handler
Failure/Error: t.join
ThreadError:
can't be called from trap context
# ./lib/serverengine/signal_thread.rb:138:in `unlock'
# ./lib/serverengine/signal_thread.rb:138:in `ensure in enqueue'
# ./lib/serverengine/signal_thread.rb:138:in `enqueue'
# ./lib/serverengine/signal_thread.rb:46:in `block in trap'
# ./spec/signal_thread_spec.rb:62:in `call'
# ./spec/signal_thread_spec.rb:62:in `join'
# ./spec/signal_thread_spec.rb:62:in `block (2 levels) in '

8) ServerEngine::SignalThread should not deadlock
Failure/Error: Thread.new do
ThreadError:
can't be called from trap context
# ./lib/serverengine/signal_thread.rb:138:in `unlock'
# ./lib/serverengine/signal_thread.rb:138:in `ensure in enqueue'
# ./lib/serverengine/signal_thread.rb:138:in `enqueue'
# ./lib/serverengine/signal_thread.rb:46:in `block in trap'
# ./spec/signal_thread_spec.rb:73:in `call'
# ./spec/signal_thread_spec.rb:73:in `new'
# ./spec/signal_thread_spec.rb:73:in `block (3 levels) in '
# ./spec/signal_thread_spec.rb:72:in `each'
# ./spec/signal_thread_spec.rb:72:in `map'

9) ServerEngine::Supervisor start and graceful stop
Failure/Error: test_state(:server_before_run).should == 1
expected: 1
got: 0 (using ==)
# ./spec/supervisor_spec.rb:19:in `block (2 levels) in '

10) ServerEngine::Supervisor immediate stop
Failure/Error: test_state(:server_stop).should == 1
expected: 1
got: 0 (using ==)
# ./spec/supervisor_spec.rb:44:in `block (2 levels) in '

11) ServerEngine::Supervisor graceful restart
Failure/Error: test_state(:server_stop).should == 1
expected: 1
got: 0 (using ==)
# ./spec/supervisor_spec.rb:63:in `block (2 levels) in '

12) ServerEngine::Supervisor immediate restart
Failure/Error: test_state(:server_stop).should == 1
expected: 1
got: 0 (using ==)
# ./spec/supervisor_spec.rb:84:in `block (2 levels) in '

13) ServerEngine::Supervisor reload
Failure/Error: test_state(:server_stop).should == 1
expected: 1
got: 0 (using ==)
# ./spec/supervisor_spec.rb:105:in `block (2 levels) in '