Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Zookeeper >> mail # user >> Simulating ConnectionLossException and SessionExpiredException events during integration testing


+
Todd Nine 2011-06-16, 04:37
+
Thijs Terlouw 2011-06-16, 05:59
+
Ted Dunning 2011-06-16, 07:16
Copy link to this message
-
Re: Simulating ConnectionLossException and SessionExpiredException events during integration testing
See https://issues.apache.org/jira/browse/ZOOKEEPER-829

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]
> >wrote:
>
> > 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]>
> wrote:
> > > 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
> edge
> > > cases that are caused by ConnectionLossException and
> > > SessionExpiredException.  Is there any good way to simulate these
> events
> > 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