diff options
author | Benoit Foucher <benoit@zeroc.com> | 2019-08-22 16:14:09 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2019-08-22 16:14:09 +0200 |
commit | b0f6341f4ef05ee6f59b61bb18e7722e3f96347d (patch) | |
tree | b6653af34c38222d0e1f4eed9d6674caadf5a0c0 /ruby | |
parent | Workaround for AIX issue with SSL_write and EWOULDBLOCK (diff) | |
download | ice-b0f6341f4ef05ee6f59b61bb18e7722e3f96347d.tar.bz2 ice-b0f6341f4ef05ee6f59b61bb18e7722e3f96347d.tar.xz ice-b0f6341f4ef05ee6f59b61bb18e7722e3f96347d.zip |
Fixed Ice/timeout test to ensure the client doesn't hang in case of test failure
Diffstat (limited to 'ruby')
-rw-r--r-- | ruby/test/Ice/timeout/AllTests.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/ruby/test/Ice/timeout/AllTests.rb b/ruby/test/Ice/timeout/AllTests.rb index 37898d0c7ff..24636c98ded 100644 --- a/ruby/test/Ice/timeout/AllTests.rb +++ b/ruby/test/Ice/timeout/AllTests.rb @@ -17,6 +17,20 @@ def connect(prx) end def allTests(helper, communicator) + controller = Test::ControllerPrx::checkedCast( + communicator.stringToProxy("controller:#{helper.getTestEndpoint(num:1)}")) + test(controller) + begin + allTestsWithController(helper, communicator, controller) + rescue + # Ensure the adapter is not in the holding state when an unexpected exception occurs to prevent + # the test from hanging on exit in case a connection which disables timeouts is still opened. + controller.holdAdapter() + raise + end +end + +def allTestsWithController(helper, communicator, controller) sref = "timeout:#{helper.getTestEndpoint()}" obj = communicator.stringToProxy(sref) test(obj) @@ -24,10 +38,6 @@ def allTests(helper, communicator) timeout = Test::TimeoutPrx::checkedCast(obj) test(timeout) - controller = Test::ControllerPrx::checkedCast( - communicator.stringToProxy("controller:#{helper.getTestEndpoint(num:1)}")) - test(controller) - print "testing connect timeout... " STDOUT.flush # |