浏览代码

Ticket 47787: Make the test case more robust

Description
	Sometime the MOD (description) M2->M1 takes some time and we need to be sure it is
	replicated before checking that the target entry is identical M1 vs. M2
https://fedorahosted.org/389/ticket/47787

reviewed by: Mark Reynolds (Thanks Mark !)

Platforms tested: F20

Flag Day: no

Doc impact: no
Thierry bordaz (tbordaz) 11 年之前
父节点
当前提交
52e57deb42
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. 10 1
      dirsrvtests/tickets/ticket47787_test.py

+ 10 - 1
dirsrvtests/tickets/ticket47787_test.py

@@ -269,7 +269,16 @@ def _status_entry_both_server(topology, name=None, desc=None, debug=True):
     if not name:
         return
     topology.master1.log.info("\n\n######################### Tombstone on M1 ######################\n")
-    ent_m1 = _find_tombstone(topology.master1, SUFFIX, 'sn', name)
+    attr  = 'description'
+    found = False
+    attempt = 0
+    while not found and attempt < 10:
+        ent_m1 = _find_tombstone(topology.master1, SUFFIX, 'sn', name)
+        if attr in ent_m1.getAttrs():
+            found = True
+        else:
+            time.sleep(1)
+            attempt = attempt + 1
     assert ent_m1
     
     topology.master1.log.info("\n\n######################### Tombstone on M2 ######################\n")