Bug 47412 - Fix wait_for_replication in ucs-test (Backport 4.2)
Fix wait_for_replication in ucs-test (Backport 4.2)
Status: CLOSED FIXED
Product: UCS Test
Classification: Unclassified
Component: General
unspecified
Other Linux
: P5 normal (vote)
: ---
Assigned To: Jürn Brodersen
Daniel Tröder
:
Depends on: 47208
Blocks:
  Show dependency treegraph
 
Reported: 2018-07-30 12:58 CEST by Daniel Tröder
Modified: 2023-03-25 06:46 CET (History)
0 users

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
troeder: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2018-07-30 12:58:39 CEST
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.
Comment 1 Jürn Brodersen univentionstaff 2018-08-01 13:37:30 CEST
[4.2-4 a3558b8cb8] Bug #47412: Let wait_for_replication wait until listener and notifier id are equal
Comment 2 Jürn Brodersen univentionstaff 2018-08-01 14:01:38 CEST
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
Comment 3 Daniel Tröder univentionstaff 2018-08-15 12:24:23 CEST
OK: code change
OK: "Invalid number of removed users" problem is gone - nice!