Univention Bugzilla – Bug 47412
Fix wait_for_replication in ucs-test (Backport 4.2)
Last modified: 2023-03-25 06:46:54 CET
Please backport commit "[4.3-1 002c4e749e] Bug #47208: Let wait_for_replication wait until listener and notifier id are equal" to UCS 4.2. Some ucs-tests are failing, because modifications are not done, although wait_for_replication() has returned sucessfully. For example this: http://jenkins.knut.univention.de:8080/job/UCSschool%204.2/job/UCSschool%204.2%20Singleserver/576/ImportTests=ImportTests,SambaVersion=s4/testReport/junit/90_ucsschool/225_import-users_username_length/test/ [2018-07-29 18:20:43.175493] 2018-07-29 18:20:43 ERROR: check_new_and_removed_users:250: Invalid number of removed users (expected 0, found 1)! Removed objects: ['uid=izo34a4cur,cn=lehrer und mitarbeiter,cn=users,ou=saz7vlpnhgy,dc=autotest201,dc=local'] But uid=izo34a4cur has been created and deleted in the previous test: 224_import-users_test_format_hook -------------------------------------------------------------- base.create_without_hooks:435 Creating ImportTeachersAndStaff(name=u'izo34a4cur', school='saz7vlpnhgy', dn=u'uid=izo34a4cur,cn=lehrer [..] removing DN: uid=izo34a4cur,cn=lehrer und mitarbeiter,cn=users,ou=saz7vlpnhgy,dc=autotest201,dc=local [..] Waiting for replication... . Done: replication complete. [..] *** END *** 0 *** *** BEGIN *** ['/usr/bin/python', '225_import-users_username_length'] *** [..] Removed objects: set(['uid=izo34a4cur,cn=lehrer... ERROR: check_new_and_removed_users:250: Invalid number of removed users (expected 0, found 1)! Removed objects: ['uid=izo34a4cur,cn=leh... -------------------------------------------------------------- +++ This bug was initially created as a clone of Bug #47208 +++ 70_users_module fails It looks like wait_for_replication from testing.utils does not wait for replication. The function wait_for_replication uses the nagios check "check_univention_replication" which is successful (if called without any options) as long as the listener id increased since the last check. In this case the previous check did not call wait_for_replication after it was done. Now wait_for_replication immediately returned because something got replicated. Resulting in an increasing difference in listener and notifier ids until verify_ldap_object ran into a timeout (because the replication was far behind) and the test failed.
[4.2-4 a3558b8cb8] Bug #47412: Let wait_for_replication wait until listener and notifier id are equal
The first commit updated subproject commits by accidents. That commit was reverted. [4.2-4 a3558b8cb8] Bug #47412: Let wait_for_replication wait until listener and notifier id are equal [4.2-4 9320a27382] Revert "Bug #47412: Let wait_for_replication wait until listener and notifier id are equal" [4.2-4 8c232c9fec] Bug #47412: Let wait_for_replication wait until listener and notifier id are equal
OK: code change OK: "Invalid number of removed users" problem is gone - nice!