Permalink
Browse files

CBQE-2328: Add test to repro MB-11698

Change-Id: I556f2c789cc1ce6e7c678dcb1a27fc579ce8936f
Reviewed-on: http://review.couchbase.org/39441
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Ketaki Gangal <ketakigangal@gmail.com>
  • Loading branch information...
1 parent 42c3b0c commit 7535c6b13b76ef4485a68cf98d0bcce1991b078c @IrynaMironava IrynaMironava committed with ketakigangal Jul 16, 2014
Showing with 31 additions and 0 deletions.
  1. +2 −0 conf/py-eviction.conf
  2. +29 −0 pytests/eviction/eviction_change_policy.py
@@ -3,4 +3,6 @@ eviction.evictionkv.EvictionKV:
test_eject_all_ops,dgm_run=True,eviction_policy=fullEviction
test_purge_ejected_docs,dgm_run=True,eviction_policy=fullEviction
test_update_ejected_expiry_time,dgm_run=True,eviction_policy=fullEviction
+eviction.eviction_change_policy.EvictionChangePolicy:
+ test_reproducer_MB_11698,nodes_init=3,items=10000,eviction_policy=fullEviction
@@ -0,0 +1,29 @@
+import time
+from couchbase.documentgenerator import BlobGenerator
+from eviction.evictionbase import EvictionBase
+from membase.helper.cluster_helper import ClusterOperationHelper
+from remote.remote_util import RemoteMachineShellConnection
+
+class EvictionChangePolicy(EvictionBase):
+
+ def test_reproducer_MB_11698(self):
+ gen_create = BlobGenerator('eviction', 'eviction-', self.value_size, end=self.num_items)
+ gen_create2 = BlobGenerator('eviction2', 'eviction2-', self.value_size, end=self.num_items)
+ self._load_all_buckets(self.master, gen_create, "create", 0)
+ self._wait_for_stats_all_buckets(self.servers[:self.nodes_init])
+ self._verify_stats_all_buckets(self.servers[:self.nodes_init])
+ remote = RemoteMachineShellConnection(self.master)
+ for bucket in self.buckets:
+ output, _ = remote.execute_couchbase_cli(cli_command='bucket-edit',
+ cluster_host="localhost",
+ user=self.master.rest_username,
+ password=self.master.rest_password,
+ options='--bucket=%s --bucket-eviction-policy=valueOnly' % bucket.name)
+ self.assertTrue(' '.join(output).find('SUCCESS') != -1, 'Eviction policy wasn\'t changed')
+ ClusterOperationHelper.wait_for_ns_servers_or_assert(
+ self.servers[:self.nodes_init], self,
+ wait_time=self.wait_timeout, wait_if_warmup=True)
+ self.sleep(10, 'Wait some time before next load')
+ self._load_all_buckets(self.master, gen_create2, "create", 0)
+ self._wait_for_stats_all_buckets(self.servers[:self.nodes_init], timeout=self.wait_timeout * 5)
+ self._verify_stats_all_buckets(self.servers[:self.nodes_init])

0 comments on commit 7535c6b

Please sign in to comment.