Skip to content

Commit 8ba1f45

Browse files
committed
Removing redundent subdoc syncwrite tests
Replaicing few constants Change-Id: Ifa1094aa757be9c07a55ad3a85f2533ee67e0101 Reviewed-on: http://review.couchbase.org/c/TAF/+/154773 Tested-by: Build Bot <build@couchbase.com> Tested-by: Balakumaran G <balakumaran.gopal@couchbase.com> Reviewed-by: Balakumaran G <balakumaran.gopal@couchbase.com>
1 parent 9ffa554 commit 8ba1f45

3 files changed

Lines changed: 24 additions & 20 deletions

File tree

conf/ep_engine/durability_timeouts.conf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ epengine.durability_failures.TimeoutTests:
1414
test_timeout_with_crud_failures,nodes_init=1,replicas=0,num_items=10000,sdk_timeout=60,simulate_error=stop_persistence,GROUP=P0;NotForMajority;MHBeta
1515
test_timeout_with_crud_failures,nodes_init=2,replicas=1,num_items=10000,sdk_timeout=60,simulate_error=stop_persistence,GROUP=P0;NotForMajority;MHBeta
1616
test_timeout_with_crud_failures,nodes_init=4,replicas=2,num_items=10000,sdk_timeout=60,simulate_error=stop_persistence,GROUP=P0;NotForMajority;MHBeta
17-
test_timeout_with_crud_failures,nodes_init=4,replicas=2,num_items=10000,sdk_timeout=60,simulate_error=stop_persistence,GROUP=P0;NotForMajority;MHBeta
17+
# test_timeout_with_crud_failures,nodes_init=4,replicas=3,num_items=10000,sdk_timeout=60,simulate_error=stop_persistence,GROUP=P0;NotForMajority;MHBeta
1818

1919
subdoc.sub_doc_failures.SubDocTimeouts:
2020
test_timeout_with_successful_crud,nodes_init=1,replicas=0,num_items=20000,sdk_timeout=60,simulate_error=stop_memcached,GROUP=P0
@@ -23,6 +23,4 @@ subdoc.sub_doc_failures.SubDocTimeouts:
2323

2424
test_timeout_with_crud_failures,nodes_init=1,replicas=0,num_items=20000,sdk_timeout=10,simulate_error=stop_persistence,GROUP=P0;NotForMajority
2525
test_timeout_with_crud_failures,nodes_init=4,replicas=1,num_items=20000,sdk_timeout=10,simulate_error=stop_persistence,GROUP=P0;NotForMajority
26-
test_timeout_with_crud_failures,nodes_init=4,replicas=2,num_items=20000,sdk_timeout=10,simulate_error=stop_persistence,GROUP=P1;NotForMajority
27-
test_timeout_with_crud_failures,nodes_init=4,replicas=2,num_items=20000,sdk_timeout=10,simulate_error=stop_persistence,GROUP=P1;NotForMajority
2826

lib/BucketLib/bucket.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ class FlushBucket(object):
174174
ENABLED = 1
175175

176176
class vBucket:
177+
ACTIVE = "active"
178+
REPLICA = "replica"
179+
177180
def __init__(self):
178181
self.master = ''
179182
self.replica = []

pytests/subdoc/sub_doc_failures.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -223,26 +223,28 @@ def validate_vb_seqno_stats():
223223
% (vb_id,
224224
vb_info["init"][node.ip][vb_id],
225225
vb_info["post_timeout"][node.ip][vb_id]))
226-
elif int(vb_id) in target_nodes_vbuckets["active"]:
226+
elif int(vb_id) \
227+
in target_nodes_vbuckets[Bucket.vBucket.ACTIVE]:
227228
if vb_id in vb_info["init"][node.ip].keys() \
228229
and vb_info["init"][node.ip][vb_id] \
229230
!= vb_info["post_timeout"][node.ip][vb_id]:
230231
self.log.warning(
231232
err_msg
232233
% (node.ip,
233-
"active",
234+
Bucket.vBucket.ACTIVE,
234235
vb_id,
235236
vb_info["init"][node.ip][vb_id],
236237
vb_info["post_timeout"][node.ip][vb_id]))
237-
elif int(vb_id) in target_nodes_vbuckets["replica"]:
238+
elif int(vb_id) \
239+
in target_nodes_vbuckets[Bucket.vBucket.REPLICA]:
238240
if vb_id in vb_info["init"][node.ip].keys() \
239241
and vb_info["init"][node.ip][vb_id] \
240242
== vb_info["post_timeout"][node.ip][vb_id]:
241243
retry_validation = True
242244
self.log.warning(
243245
err_msg
244246
% (node.ip,
245-
"replica",
247+
Bucket.vBucket.REPLICA,
246248
vb_id,
247249
vb_info["init"][node.ip][vb_id],
248250
vb_info["post_timeout"][node.ip][vb_id]))
@@ -257,8 +259,8 @@ def validate_vb_seqno_stats():
257259
doc_gen = dict()
258260
affected_vbs = list()
259261

260-
target_nodes_vbuckets["active"] = []
261-
target_nodes_vbuckets["replica"] = []
262+
target_nodes_vbuckets[Bucket.vBucket.ACTIVE] = list()
263+
target_nodes_vbuckets[Bucket.vBucket.REPLICA] = list()
262264
vb_info["init"] = dict()
263265
vb_info["post_timeout"] = dict()
264266
vb_info["afterCrud"] = dict()
@@ -270,25 +272,25 @@ def validate_vb_seqno_stats():
270272
for node in target_nodes:
271273
shell_conn[node.ip] = RemoteMachineShellConnection(node)
272274
cbstat_obj[node.ip] = Cbstats(shell_conn[node.ip])
273-
target_nodes_vbuckets["active"] += \
274-
cbstat_obj[node.ip].vbucket_list(self.bucket.name,
275-
vbucket_type="active")
276-
target_nodes_vbuckets["replica"] += \
277-
cbstat_obj[node.ip].vbucket_list(self.bucket.name,
278-
vbucket_type="replica")
275+
target_nodes_vbuckets[Bucket.vBucket.ACTIVE] += \
276+
cbstat_obj[node.ip].vbucket_list(
277+
self.bucket.name, vbucket_type=Bucket.vBucket.ACTIVE)
278+
target_nodes_vbuckets[Bucket.vBucket.REPLICA] += \
279+
cbstat_obj[node.ip].vbucket_list(
280+
self.bucket.name, vbucket_type=Bucket.vBucket.REPLICA)
279281
vb_info["init"][node.ip] = cbstat_obj[node.ip].vbucket_seqno(
280282
self.bucket.name)
281283
error_sim[node.ip] = CouchbaseError(self.log, shell_conn[node.ip])
282284

283285
curr_time = int(time.time())
284286
expected_timeout = curr_time + self.sdk_timeout
285287

286-
target_vbs = target_nodes_vbuckets["active"]
288+
target_vbs = target_nodes_vbuckets[Bucket.vBucket.ACTIVE]
287289
if self.nodes_init == 1:
288290
pass
289291
elif self.durability_level \
290292
== Bucket.DurabilityLevel.PERSIST_TO_MAJORITY:
291-
target_vbs = target_nodes_vbuckets["replica"]
293+
target_vbs = target_nodes_vbuckets[Bucket.vBucket.REPLICA]
292294

293295
# Create required doc_generators
294296
doc_gen["insert"] = sub_doc_generator(
@@ -343,7 +345,7 @@ def validate_vb_seqno_stats():
343345
self.task.jython_task_manager.get_task_result(tasks[op_type])
344346

345347
# Validate task failures
346-
if op_type == "read":
348+
if op_type == DocLoading.Bucket.DocOps.READ:
347349
# Validation for read task
348350
if len(tasks[op_type].fail.keys()) != 0:
349351
self.log_failure("Read failed for few docs: %s"
@@ -369,7 +371,7 @@ def validate_vb_seqno_stats():
369371
self.log_failure("Timed-out before expected time")
370372

371373
for op_type in doc_gen.keys():
372-
if op_type == "read":
374+
if op_type == DocLoading.Bucket.DocOps.READ:
373375
continue
374376
while doc_gen[op_type].has_next():
375377
doc_id, _ = doc_gen[op_type].next()
@@ -403,7 +405,8 @@ def validate_vb_seqno_stats():
403405
if self.nodes_init == self.num_replicas+1:
404406
read_gen = doc_generator(self.key, 0, self.num_items)
405407
read_task = self.task.async_load_gen_docs(
406-
self.cluster, self.bucket, read_gen, "read", 0,
408+
self.cluster, self.bucket, read_gen,
409+
DocLoading.Bucket.DocOps.READ, 0,
407410
batch_size=500, process_concurrency=1,
408411
timeout_secs=self.sdk_timeout)
409412
self.task_manager.get_task_result(read_task)

0 commit comments

Comments
 (0)