Permalink
Browse files

CBQE-773: create basic performance regressions tests

example:
rebalance.rebalanceinout.RebalanceInOutTests.rebalance_in_out_at_once,default_bucket=True,standard_buckets=1,sasl_buckets=1,replicas=1,nodes_init=3,nodes_in=1,nodes_out=1,items=1000000

Change-Id: Ibb296b7e95a5d30905c10dbf5e5fc89d2ae42f2f
Reviewed-on: http://review.couchbase.org/22448
Reviewed-by: Andrei Baranouski <andrei.baranouski@gmail.com>
Tested-by: Andrei Baranouski <andrei.baranouski@gmail.com>
  • Loading branch information...
1 parent 43b622d commit b55aa9cff72a32712ea99717bbe5d01098c1ecb0 @andreibaranouski andreibaranouski committed with andreibaranouski Nov 12, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 pytests/rebalance/rebalanceinout.py
@@ -217,3 +217,23 @@ def incremental_rebalance_in_out_with_mutation_and_expiration(self):
task.result()
self._load_all_buckets(self.master, gen_expire, "create", 0)
self.verify_cluster_stats(self.servers[:self.num_servers])
+
+ """Rebalance in/out at once.
+
+ This test begins by loading a given number of items into the cluster. It then
+ add servs_in nodes and remove servs_out nodes and start rebalance.
+ Once cluster was rebalanced the test is finished.
+ Available parameters by default are:
+ nodes_init=1, nodes_in=1, nodes_out=1"""
+ def rebalance_in_out_at_once(self):
+ servs_init = self.servers[:self.nodes_init]
+ servs_in = [self.servers[i + self.nodes_init] for i in range(self.nodes_in)]
+ servs_out = [self.servers[self.nodes_init - i - 1] for i in range(self.nodes_out)]
+ rest = RestConnection(self.master)
+ self._wait_for_stats_all_buckets(servs_init)
+ self.log.info("current nodes : {0}".format([node.id for node in rest.node_statuses()]))
+ self.log.info("adding nodes {0} to cluster".format(servs_in))
+ self.log.info("removing nodes {0} from cluster".format(servs_out))
+ result_nodes = set(servs_init + servs_in) - set(servs_out)
+ self.cluster.rebalance(servs_init[:self.nodes_init], servs_in, servs_out)
+ self.verify_cluster_stats(result_nodes)

0 comments on commit b55aa9c

Please sign in to comment.