Testing for #answer fails

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Testing for #answer fails

Hans Fritz
Hi,

I'd like to make sure the call receives the #answer message.

Here is my test: https://gist.github.com/Coaxial/6a0002761ce6c2704747

It fails with:
Failure/Error: subject.run
fatal:
No live threads left. Deadlock?

How do I avoid this failure? What am I missing to test that the call is indeed answered?

Thanks,

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Testing for #answer fails

Ben Langfeld-2
Did you not get a backtrace here? What if you run RSpec with the -b option?

On 17 August 2015 at 17:01, Hans Fritz <[hidden email]> wrote:
Hi,

I'd like to make sure the call receives the #answer message.


It fails with:
Failure/Error: subject.run
fatal:
No live threads left. Deadlock?

How do I avoid this failure? What am I missing to test that the call is indeed answered?

Thanks,

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Testing for #answer fails

Hans Fritz
This is the full trace with -b for the failing test:


Failures:

  1) OutboundCallController answers the call
     Failure/Error: subject.run
     fatal:
       No live threads left. Deadlock?
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:110:in `sleep'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:110:in `wait'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:110:in `wait'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/future-resource-1.1.0/lib/future-resource.rb:66:in `block (2 levels) in resource'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/future-resource-1.1.0/lib/future-resource.rb:65:in `block in resource'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/timeout.rb:74:in `timeout'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/future-resource-1.1.0/lib/future-resource.rb:64:in `resource'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/punchblock-2.7.2/lib/punchblock/component/component_node.rb:51:in `complete_event'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/adhearsion-2.6.2/lib/adhearsion/call_controller.rb:223:in `execute_component_and_await_completion'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/adhearsion-2.6.2/lib/adhearsion/call_controller/output/player.rb:18:in `output'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/adhearsion-2.6.2/lib/adhearsion/call_controller/output.rb:27:in `say'
     # ./app/call_controllers/outbound_call.rb:14:in `run'
     # ./spec/call_controllers/outbound_call_spec.rb:14:in `block (2 levels) in <top (required)>'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:206:in `instance_exec'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:206:in `block in run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:430:in `block in with_around_and_singleton_context_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:388:in `block in with_around_example_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:478:in `block in run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:616:in `run_around_example_hooks_for'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:478:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:388:in `with_around_example_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:430:in `with_around_and_singleton_context_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:203:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:559:in `block in run_examples'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:555:in `map'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:555:in `run_examples'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:521:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:115:in `block (3 levels) in run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:115:in `map'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:115:in `block (2 levels) in run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1627:in `with_suite_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:114:in `block in run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:77:in `report'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:113:in `run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:89:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:73:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:41:in `invoke'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/exe/rspec:4:in `<top (required)>'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/rspec:23:in `load'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/rspec:23:in `<main>'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

Finished in 0.60279 seconds (files took 1.27 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/call_controllers/outbound_call_spec.rb:11 # OutboundCallController answers the call

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Testing for #answer fails

Ben Langfeld-2
So your call controller is performing output which never receives a completion event (because your tests don't generate one) and therefore the controller deadlocks.

You need to mock your output also.

On 18 August 2015 at 16:09, Hans Fritz <[hidden email]> wrote:
This is the full trace with -b for the failing test:


Failures:

  1) OutboundCallController answers the call
     Failure/Error: subject.run
     fatal:
       No live threads left. Deadlock?
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:110:in `sleep'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:110:in `wait'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:110:in `wait'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/future-resource-1.1.0/lib/future-resource.rb:66:in `block (2 levels) in resource'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/future-resource-1.1.0/lib/future-resource.rb:65:in `block in resource'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/timeout.rb:74:in `timeout'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/future-resource-1.1.0/lib/future-resource.rb:64:in `resource'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/punchblock-2.7.2/lib/punchblock/component/component_node.rb:51:in `complete_event'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/adhearsion-2.6.2/lib/adhearsion/call_controller.rb:223:in `execute_component_and_await_completion'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/adhearsion-2.6.2/lib/adhearsion/call_controller/output/player.rb:18:in `output'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/adhearsion-2.6.2/lib/adhearsion/call_controller/output.rb:27:in `say'
     # ./app/call_controllers/outbound_call.rb:14:in `run'
     # ./spec/call_controllers/outbound_call_spec.rb:14:in `block (2 levels) in <top (required)>'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:206:in `instance_exec'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:206:in `block in run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:430:in `block in with_around_and_singleton_context_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:388:in `block in with_around_example_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:478:in `block in run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:616:in `run_around_example_hooks_for'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:478:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:388:in `with_around_example_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:430:in `with_around_and_singleton_context_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:203:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:559:in `block in run_examples'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:555:in `map'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:555:in `run_examples'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:521:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:115:in `block (3 levels) in run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:115:in `map'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:115:in `block (2 levels) in run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1627:in `with_suite_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:114:in `block in run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:77:in `report'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:113:in `run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:89:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:73:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:41:in `invoke'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/exe/rspec:4:in `<top (required)>'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/rspec:23:in `load'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/rspec:23:in `<main>'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

Finished in 0.60279 seconds (files took 1.27 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/call_controllers/outbound_call_spec.rb:11 # OutboundCallController answers the call

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Testing for #answer fails

Hans Fritz
I'm still confused. What does a completion event look like? By mocking the output, are you talking about a Player object?
Is there an example I could look at somewhere? I couldn't find any, it seems the open source Adhearsion apps are rare in the wild.

On 18 August 2015 at 15:45, Ben Langfeld <[hidden email]> wrote:
So your call controller is performing output which never receives a completion event (because your tests don't generate one) and therefore the controller deadlocks.

You need to mock your output also.

On 18 August 2015 at 16:09, Hans Fritz <[hidden email]> wrote:
This is the full trace with -b for the failing test:


Failures:

  1) OutboundCallController answers the call
     Failure/Error: subject.run
     fatal:
       No live threads left. Deadlock?
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:110:in `sleep'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:110:in `wait'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:110:in `wait'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/future-resource-1.1.0/lib/future-resource.rb:66:in `block (2 levels) in resource'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/future-resource-1.1.0/lib/future-resource.rb:65:in `block in resource'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/timeout.rb:74:in `timeout'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/future-resource-1.1.0/lib/future-resource.rb:64:in `resource'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/punchblock-2.7.2/lib/punchblock/component/component_node.rb:51:in `complete_event'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/adhearsion-2.6.2/lib/adhearsion/call_controller.rb:223:in `execute_component_and_await_completion'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/adhearsion-2.6.2/lib/adhearsion/call_controller/output/player.rb:18:in `output'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/adhearsion-2.6.2/lib/adhearsion/call_controller/output.rb:27:in `say'
     # ./app/call_controllers/outbound_call.rb:14:in `run'
     # ./spec/call_controllers/outbound_call_spec.rb:14:in `block (2 levels) in <top (required)>'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:206:in `instance_exec'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:206:in `block in run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:430:in `block in with_around_and_singleton_context_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:388:in `block in with_around_example_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:478:in `block in run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:616:in `run_around_example_hooks_for'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:478:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:388:in `with_around_example_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:430:in `with_around_and_singleton_context_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:203:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:559:in `block in run_examples'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:555:in `map'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:555:in `run_examples'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:521:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:115:in `block (3 levels) in run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:115:in `map'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:115:in `block (2 levels) in run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1627:in `with_suite_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:114:in `block in run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:77:in `report'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:113:in `run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:89:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:73:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:41:in `invoke'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/exe/rspec:4:in `<top (required)>'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/rspec:23:in `load'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/rspec:23:in `<main>'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

Finished in 0.60279 seconds (files took 1.27 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/call_controllers/outbound_call_spec.rb:11 # OutboundCallController answers the call

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Adhearsion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adhearsion/2FtOk-R2xc0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Testing for #answer fails

Ben Langfeld-2
Normally you would mock the call to #output:

expect(subject).to receive(:output).with(...)

On 18 August 2015 at 19:50, Hans Fritz <[hidden email]> wrote:
I'm still confused. What does a completion event look like? By mocking the output, are you talking about a Player object?
Is there an example I could look at somewhere? I couldn't find any, it seems the open source Adhearsion apps are rare in the wild.

On 18 August 2015 at 15:45, Ben Langfeld <[hidden email]> wrote:
So your call controller is performing output which never receives a completion event (because your tests don't generate one) and therefore the controller deadlocks.

You need to mock your output also.

On 18 August 2015 at 16:09, Hans Fritz <[hidden email]> wrote:
This is the full trace with -b for the failing test:


Failures:

  1) OutboundCallController answers the call
     Failure/Error: subject.run
     fatal:
       No live threads left. Deadlock?
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:110:in `sleep'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:110:in `wait'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:110:in `wait'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/future-resource-1.1.0/lib/future-resource.rb:66:in `block (2 levels) in resource'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/future-resource-1.1.0/lib/future-resource.rb:65:in `block in resource'
     # /Users/coaxial/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/timeout.rb:74:in `timeout'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/future-resource-1.1.0/lib/future-resource.rb:64:in `resource'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/punchblock-2.7.2/lib/punchblock/component/component_node.rb:51:in `complete_event'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/adhearsion-2.6.2/lib/adhearsion/call_controller.rb:223:in `execute_component_and_await_completion'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/adhearsion-2.6.2/lib/adhearsion/call_controller/output/player.rb:18:in `output'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/adhearsion-2.6.2/lib/adhearsion/call_controller/output.rb:27:in `say'
     # ./app/call_controllers/outbound_call.rb:14:in `run'
     # ./spec/call_controllers/outbound_call_spec.rb:14:in `block (2 levels) in <top (required)>'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:206:in `instance_exec'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:206:in `block in run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:430:in `block in with_around_and_singleton_context_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:388:in `block in with_around_example_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:478:in `block in run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:616:in `run_around_example_hooks_for'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb:478:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:388:in `with_around_example_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:430:in `with_around_and_singleton_context_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example.rb:203:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:559:in `block in run_examples'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:555:in `map'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:555:in `run_examples'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb:521:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:115:in `block (3 levels) in run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:115:in `map'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:115:in `block (2 levels) in run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1627:in `with_suite_hooks'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:114:in `block in run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:77:in `report'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:113:in `run_specs'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:89:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:73:in `run'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:41:in `invoke'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/exe/rspec:4:in `<top (required)>'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/rspec:23:in `load'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/rspec:23:in `<main>'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
     # /Users/coaxial/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

Finished in 0.60279 seconds (files took 1.27 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/call_controllers/outbound_call_spec.rb:11 # OutboundCallController answers the call

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Adhearsion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adhearsion/2FtOk-R2xc0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Testing for #answer fails

Hans Fritz
Alright, I got it. I just had to mock every method in the controller that interacts with the call such as answer, say, hangup etc. It works now, thanks.

On Tuesday, 18 August 2015 18:59:23 UTC-4, Ben Langfeld wrote:
Normally you would mock the call to #output:

expect(subject).to receive(:output).with(...) 

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.