Todd Nine 2011-06-16, 04:37
Thijs Terlouw 2011-06-16, 05:59
Ted Dunning 2011-06-16, 07:16
-Re: Simulating ConnectionLossException and SessionExpiredException events during integration testing
On Thu, Jun 16, 2011 at 1:16 AM, Ted Dunning <[EMAIL PROTECTED]> wrote:
> The other method which is used in the ZK test cases is to make a second
> connection with the same session id and then close that session. This
> causes the first connection to get a session expiration.
> On Thu, Jun 16, 2011 at 7:59 AM, Thijs Terlouw <[EMAIL PROTECTED]
> > I recently used iptables on Linux to test these edge cases:
> > You just drop all traffic to the zookeeper server ip/port:
> > "iptables -D OUTPUT -p tcp -dport 2181 -j DROP"
> > then you wait a couple of seconds (longer than the session expiration
> > value, depends on your configuration) and then remove this iptables
> > rule again. The ZK Client library will reconnect and will receive
> > SessionExpired.
> > Not sure your embedded zookeeper is used via tcp, but you could always
> > test with a standalone zookeeper server.
> > Thijs
> > On Thu, Jun 16, 2011 at 12:37 PM, Todd Nine <[EMAIL PROTECTED]>
> > > Hi guys,
> > > I've written quite a few integration tests around our zookeeper
> > > functionality. However I find I'm having a really hard time testing
> > > cases that are caused by ConnectionLossException and
> > > SessionExpiredException. Is there any good way to simulate these
> > in
> > > an embedded zookeeper runtime and then ensure a new client is created?
> > >
> > > Thanks,
> > > Todd
> > >
> > --
> > Thijs Terlouw,
> > Shenzhen, China
> > http://www.startinchina.com
Patrick Hunt 2011-06-16, 17:24
Jared Cantwell 2011-06-16, 17:30