Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CBQE-0 :: fix validation test related failures for vbucket distribution

Change-Id: I11c090faad2b2b854ac1d1768ed905474d6efa30
Reviewed-on: http://review.couchbase.org/39585
Reviewed-by: Parag Agarwal <agarwal.parag@gmail.com>
Tested-by: Parag Agarwal <agarwal.parag@gmail.com>
  • Loading branch information...
commit 0af37ba50828ff726f9c4b7a56052c9041aa1d2c 1 parent 2bb6711
@paragagarwal paragagarwal authored karma2ns committed
View
8 pytests/basetestcase.py
@@ -1116,6 +1116,10 @@ def vb_distribution_analysis(self, servers = [], buckets = [], total_vbuckets =
Method to check vbucket distribution analysis after rebalance
"""
self.log.info(" Begin Verification for vb_distribution_analysis")
+ if self.std_vbucket_dist != None:
+ std = self.std_vbucket_dist
+ if self.vbuckets != None and self.vbuckets != self.total_vbuckets:
+ self.total_vbuckets = self.vbuckets
active,replica=self.get_vb_distribution_active_replica(servers = servers, buckets = buckets)
for bucket in active.keys():
self.log.info(" Begin Verification for Bucket {0}".format(bucket))
@@ -1123,9 +1127,9 @@ def vb_distribution_analysis(self, servers = [], buckets = [], total_vbuckets =
replica_result = replica[bucket]
self.assertTrue(active_result["total"] == total_vbuckets, "total vbuckets do not match for active data set, actual {0} expectecd {1}".format(active_result["total"] ,total_vbuckets))
if type == "rebalance":
- self.assertTrue(replica_result["total"] == total_vbuckets, "total vbuckets do not match for replica data set (= criteria), actual {0} expectecd {1}".format(replica_result["total"] ,total_vbuckets))
+ self.assertTrue(replica_result["total"] == self.num_replicas*total_vbuckets, "total vbuckets do not match for replica data set (= criteria), actual {0} expectecd {1}".format(replica_result["total"] ,total_vbuckets))
else:
- self.assertTrue(replica_result["total"] <= total_vbuckets, "total vbuckets do not match for replica data set (<= criteria), actual {0} expectecd {1}".format(replica_result["total"] ,total_vbuckets))
+ self.assertTrue(replica_result["total"] <= self.num_replicas*total_vbuckets, "total vbuckets do not match for replica data set (<= criteria), actual {0} expectecd {1}".format(replica_result["total"] ,total_vbuckets))
self.assertTrue(active_result["std"] >= 0.0 and active_result["std"] <= std, "std test failed for active vbuckets")
self.assertTrue(replica_result["std"] >= 0.0 and replica_result["std"] <= std, "std test failed for replica vbuckets")
self.log.info(" End Verification for vb_distribution_analysis")
View
1  pytests/failover/failoverbasetests.py
@@ -18,6 +18,7 @@ def setUp(self):
self.default_view = View(self.default_view_name, self.defaul_map_func, None)
self.failoverMaster = self.input.param("failoverMaster", False)
self.total_vbuckets = self.input.param("total_vbuckets", 1024)
+ self.std_vbucket_dist = self.input.param("std_vbucket_dist", None)
self.withOps = self.input.param("withOps", False)
self.runViews = self.input.param("runViews", False)
self.upr_check = self.input.param("upr_check", True)
View
2  pytests/rebalance/rebalance_base.py
@@ -15,7 +15,7 @@ def setUp(self):
self.defaul_map_func = "function (doc) {\n emit(doc._id, doc);\n}"
self.default_view_name = "default_view"
self.default_view = View(self.default_view_name, self.defaul_map_func, None)
-
+ self.std_vbucket_dist = self.input.param("std_vbucket_dist", None)
#define the data that will be used to test
self.blob_generator = self.input.param("blob_generator", True)
if self.blob_generator:
Please sign in to comment.
Something went wrong with that request. Please try again.