Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CBQE-2315: add time out in test_employee_dataset_all_queries test

Change-Id: I1e9c409e71bf277fbea2aa66c8e94af6cfefac27
Reviewed-on: http://review.couchbase.org/39591
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Iryna Mironava <irynamironava@yandex.ru>
Tested-by: Meenakshi Goel <meenakshi.goel@globallogic.com>
Reviewed-by: Meenakshi Goel <meenakshi.goel@globallogic.com>
  • Loading branch information...
commit 232e55c027356df7fbdef42ccca46d883a338a53 1 parent 12ecc14
@meenakshi25 meenakshi25 authored
View
2  conf/py-4node-sanity.conf
@@ -16,7 +16,7 @@ memcapable.GetlTests.test_getl_thirty
# move this test out of sanity
# castest.opschangecas.OpsChangeCasTests.touch_test,value_size=256
drainratetests.DrainRateTests.test_drain_100k_items
-view.viewquerytests.ViewQueryTests.test_employee_dataset_all_queries,limit=1000,docs-per-day=2,wait_persistence=true
+view.viewquerytests.ViewQueryTests.test_employee_dataset_all_queries,limit=1000,docs-per-day=2,wait_persistence=true,timeout=1200
view.createdeleteview.CreateDeleteViewTests.test_view_ops,ddoc_ops=update,test_with_view=True,num_ddocs=2,num_views_per_ddoc=3,items=2000,sasl_buckets=1,standard_buckets=1
rebalance.rebalancein.RebalanceInTests.rebalance_in_with_ops,nodes_in=3,replicas=1,items=5000,doc_ops=create;update;delete
rebalance.rebalanceout.RebalanceOutTests.rebalance_out_with_ops,nodes_out=3,replicas=2,items=0
View
4 conf/simple.conf
@@ -2,7 +2,7 @@ rebalance.rebalancein.RebalanceInTests.rebalance_in_with_ops,nodes_in=3,replicas
performance.eperf.EVPerfClient.test_minimal,stats=0,items=1000,hot_init_items=1000
memcapable.WarmUpMemcachedTest.do_warmup_100k
view.createdeleteview.CreateDeleteViewTests.test_view_ops,ddoc_ops=create,test_with_view=True,num_ddocs=1,num_views_per_ddoc=10,items=1000,skip_cleanup=False
-view.viewquerytests.ViewQueryTests.test_employee_dataset_startkey_endkey_queries_rebalance_in,num_nodes_to_add=1,skip_rebalance=true,docs-per-day=1
-view.viewquerytests.ViewQueryTests.test_simple_dataset_stale_queries_data_modification,num-docs=1000,skip_rebalance=true
+view.viewquerytests.ViewQueryTests.test_employee_dataset_startkey_endkey_queries_rebalance_in,num_nodes_to_add=1,skip_rebalance=true,docs-per-day=1,timeout=1200
+view.viewquerytests.ViewQueryTests.test_simple_dataset_stale_queries_data_modification,num-docs=1000,skip_rebalance=true,timeout=1200
xdcr.uniXDCR.unidirectional.load_with_ops,replicas=1,items=10000,value_size=128,ctopology=chain,rdirection=unidirection,doc-ops=update-delete
xdcr.uniXDCR.unidirectional.load_with_failover,replicas=1,items=10000,ctopology=chain,rdirection=unidirection,doc-ops=update-delete,failover=source
View
15 pytests/view/viewquerytests.py
@@ -58,6 +58,7 @@ def setUp(self):
self.wait_persistence = self.input.param("wait_persistence", False)
self.docs_per_day = self.input.param('docs-per-day', 200)
self.retries = self.input.param('retries', 100)
+ self.timeout = self.input.param('timeout', None)
self.error = None
self.master = self.servers[0]
self.thread_crashed = Event()
@@ -1985,7 +1986,7 @@ def load(self, data_set, generators_load, exp=0, flag=0,
##
def _query_all_views(self, views, generators, kv_store=None,
verify_expected_keys=False, threads=[], retries=100,
- server_to_query=0, timeout=1200):
+ server_to_query=0):
query_threads = []
for view in views:
@@ -1996,8 +1997,14 @@ def _query_all_views(self, views, generators, kv_store=None,
query_threads.append(t)
t.start()
- end_time = time.time() + float(timeout)
- while True and time.time() < end_time:
+ if self.timeout:
+ end_time = time.time() + float(self.timeout)
+
+ while True:
+ if self.timeout:
+ if time.time() > end_time:
+ raise Exception("Test failed to finish in %s seconds" % self.timeout)
+
if not query_threads:
return
self.thread_stopped.wait(60)
@@ -2015,8 +2022,6 @@ def _query_all_views(self, views, generators, kv_store=None,
query_threads = [d for d in query_threads if d.is_alive()]
self.log.info("Current amount of threads %s" % len(query_threads))
self.thread_stopped.clear()
- if time.time() > end_time:
- raise Exception("Test failed to finish in %s seconds" % timeout)
self._check_view_intergrity(views)
Please sign in to comment.
Something went wrong with that request. Please try again.