Re: Simulating failures?

2010-06-04 Thread Patrick Hunt

Here's how to test session expiration (haven't tried this in a while):
http://github.com/phunt/zkexamples

It would be great to have some test 
infrastructure/examples/docs/strategies available for developers (zk 
client users). If someone would be interested to workon/contribute this 
we'd be pretty psyched to work with you on it.


Patrick

On 06/04/2010 11:28 AM, Stephen Green wrote:

Now that I've got things working pretty smoothly with my ZooKeeper
setup in normal operation, I'd like to test some of the recovery stuff
that I've put into my application.

I'd like to make sure that if a connection to ZK fails, then my
application recovers appropriately (possibly by giving up).  Obviously
I could do some of this by shutting off the server and restarting it,
but I'd like to be a bit more systematic, if possible.

Is there any way to inject failures into the ZK client so that I can
test without having to randomly kill servers/clients?

Thanks,

Steve


Re: Simulating failures?

2010-06-04 Thread Ted Dunning
I use mock objects to create a simulated ZK object.

Alternatively, you may be able to sub-class and delegate all ZK calls.  That
would let you inject faults.

On Fri, Jun 4, 2010 at 11:28 AM, Stephen Green wrote:

> Is there any way to inject failures into the ZK client so that I can
> test without having to randomly kill servers/clients?
>


Simulating failures?

2010-06-04 Thread Stephen Green
Now that I've got things working pretty smoothly with my ZooKeeper
setup in normal operation, I'd like to test some of the recovery stuff
that I've put into my application.

I'd like to make sure that if a connection to ZK fails, then my
application recovers appropriately (possibly by giving up).  Obviously
I could do some of this by shutting off the server and restarting it,
but I'd like to be a bit more systematic, if possible.

Is there any way to inject failures into the ZK client so that I can
test without having to randomly kill servers/clients?

Thanks,

Steve
-- 
Stephen Green
http://thesearchguy.wordpress.com