diff options
author | Michi Henning <michi@zeroc.com> | 2004-07-05 02:02:39 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2004-07-05 02:02:39 +0000 |
commit | 970d5853f5b51c007ec50ca2fc41fa1a03598084 (patch) | |
tree | d66312f64467a294c39a8eaef86a8ba3e2358806 /cpp/test/Ice/faultTolerance/TestI.cpp | |
parent | Changed Instance.cpp to print process ID only once if there are multiple (diff) | |
download | ice-970d5853f5b51c007ec50ca2fc41fa1a03598084.tar.bz2 ice-970d5853f5b51c007ec50ca2fc41fa1a03598084.tar.xz ice-970d5853f5b51c007ec50ca2fc41fa1a03598084.zip |
Updated fault tolerance tests to correctly destroy the communicator created
by the client. This has exposed a bug in the Ice run time. With the way
the test now works, the client receives a ConnectionRefusedException
whereas, previously, the adapter was deactivated on the server side.
Depending on how endpoints are shuffled in Reference.cpp, this
occasionally causes a test failure. It appears that we need to change
the run time to
- recognize when an endpoint has gone dead and react correctly
- avoid re-trying endpoints that have previously failed
As is, the test gets slower and slower towards the end because it keeps
trying endpoints of servers that were killed in previous iterations.
Diffstat (limited to 'cpp/test/Ice/faultTolerance/TestI.cpp')
-rw-r--r-- | cpp/test/Ice/faultTolerance/TestI.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/cpp/test/Ice/faultTolerance/TestI.cpp b/cpp/test/Ice/faultTolerance/TestI.cpp index 1f439c7ed7e..60c6e2dc250 100644 --- a/cpp/test/Ice/faultTolerance/TestI.cpp +++ b/cpp/test/Ice/faultTolerance/TestI.cpp @@ -10,8 +10,9 @@ #include <Ice/Ice.h> #include <TestI.h> -TestI::TestI(const Ice::ObjectAdapterPtr& adapter) : - _adapter(adapter) +TestI::TestI(const Ice::ObjectAdapterPtr& adapter, const CleanerPtr& cleaner) : + _adapter(adapter), + _cleaner(cleaner) { } @@ -48,3 +49,18 @@ TestI::pid(const Ice::Current&) return getpid(); #endif } + +CleanerI::CleanerI(const Ice::CommunicatorPtr& communicator) +{ + _communicator = communicator; +} + +void +CleanerI::cleanup(const Ice::Current&) +{ + if(_communicator) + { + _communicator->destroy(); + _communicator = 0; + } +} |