DESCRIPTION

Change tests to use bucket delete/create instead of flush_all.

Recent changes of Couchbase Server 2.0 have flush_all disabled
by default. It's also not correct to re-enable flush_all
(though possible) as it won't really behave correctly.

This change shifts to a bucket delete followed by a bucket create.
It's not the best change in that it introduces a lot of sleep time
instead of checking for bucket availability with some other poll,
but does appear to be reliable.

After the integration of RESTful flush in MB-5170, we should be
able to trim some of the time of running tests again and remove
the sleeps in here.

Change-Id: I80ed8bb311afc8dde3970db0cbad6687f58c0048


COMMENTS

author: Andreas Short
date: 2012-08-16 00:28:07.857000000

Patch Set 1: Do not submit

There are a couple of other changes that need to go into this commit, but I wanted to get a start on the review here.

-------------------------------------
author: Kenny Maynard
date: 2012-08-16 00:53:23.354000000

Patch Set 1: (8 inline comments)

Mostly minor comments except for the TestAdmin class. Let's get that fixed after the release.

Line:30, src/test/java/com/couchbase/client/CbTestConfig.java -> Whitespace

Line:38, src/test/java/com/couchbase/client/TestAdmin.java -> I don't really like the layout of this class. I think the TestAdmin should take a should really be a controller for a cluster that enables tests to be setup in custom ways. Right now the functionality is rather limited and this class will need refactoring to give it more flexibility.

I think its good for now, but we should really file a bug to get some of this stuff refactored after this release. I left a few comments below, but held of on some of the other things since they likely will need to be fixed for the next release.

Line:215, src/test/java/com/couchbase/client/TestAdmin.java -> This function should be changed to createBucket() and allow some of these parameters to be passed in. At least for now the ramQuota should be a parameter.

Line:236, src/test/java/com/couchbase/client/TestAdmin.java -> The QE team waits until the bucket accepts a set. We should do the same here because 8 seconds will not always be long enough.

Line:84, src/test/java/com/couchbase/client/TapTest.java -> Remove this line.

Line:115, src/test/java/com/couchbase/client/TapTest.java -> Remove this line.

Line:66, src/test/java/com/couchbase/client/VBucketCouchbaseClientTest.java -> Remove this line.

Line:39, src/test/java/com/couchbase/client/TestingClient.java -> This probably doesn't need to be here.

-------------------------------------
author: Andreas Short
date: 2012-08-16 02:58:14.437000000

Patch Set 1: (3 inline comments)



Line:38, src/test/java/com/couchbase/client/TestAdmin.java -> Agreed.  Before we do beta, we should have a flush from the server and a bucket management class.   This is just a means to an end right now.

Line:215, src/test/java/com/couchbase/client/TestAdmin.java -> totally agree.  My thoughts too-- even though I wrote it :)

Line:236, src/test/java/com/couchbase/client/TestAdmin.java -> Ugh.  That's crappy to code when you don't have a client.  They told me they wait until all vbuckets are okay, which is done with some unsupported internal stats check.

For now, 8 seconds seems to work.  Once we have bucket flush, we'll be rid of this monstrosity.

The alternative, by the way, is waiting until the bucket isn't pending, which we need to do anyway.

-------------------------------------
author: Andreas Short
date: 2012-08-19 00:59:42.996000000

Patch Set 1: (2 inline comments)



Line:215, src/test/java/com/couchbase/client/TestAdmin.java -> Not going to do this right now though, since it's just temporary until the bucket management features are added.

Line:236, src/test/java/com/couchbase/client/TestAdmin.java -> Not going to do this for now, since this is temporary until a bucket flush is available.  8 seconds does work for our tests, by the way.

-------------------------------------
