def do_get_random_key(self): # MB-31548, get_Random key gets hung sometimes. self.log.info("Creating few docs in the bucket") rest = RestConnection(self.master) client = VBucketAwareMemcached(rest, 'default') key = "test_docs-" for index in range(1000): doc_key = key + str(index) client.memcached(doc_key).set(doc_key, 0, 0, json.dumps({'value': 'value1'})) self.log.info("Performing random_gets") mc = MemcachedClient(self.master.ip, 11210) mc.sasl_auth_plain(self.master.rest_username, self.master.rest_password) mc.bucket_select('default') count = 0 while (count < 1000000): count = count + 1 try: mc.get_random_key() except MemcachedError as error: self.fail("<MemcachedError #%d ``%s''>" % (error.status, error.message)) if count % 1000 == 0: self.log.info('The number of iteration is {}'.format(count))
def do_get_random_key(self): # MB-31548, get_Random key gets hung sometimes. mc = MemcachedClient(self.master.ip, 11210) mc.sasl_auth_plain(self.master.rest_username, self.master.rest_password) mc.bucket_select('default') count = 0 while (count < 1000000): count = count + 1 try: mc.get_random_key() except MemcachedError as error: self.fail("<MemcachedError #%d ``%s''>" % (error.status, error.message)) if count % 1000 == 0: self.log.info('The number of iteration is {}'.format(count))