mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
s4:dsdb/test/notification: make test_invalid_filter more resilient against ordering races
We saw a lot of flapping tests with: [1793(11038)/1892 at 1h55m26s] samba4.ldap.notification.python(ad_dc_ntvfs)(ad_dc_ntvfs) UNEXPECTED(failure): samba4.ldap.notification.python(ad_dc_ntvfs).__main__.LDAPNotificationTest.test_max_search(ad_dc_ntvfs) REASON: Exception: Exception: Traceback (most recent call last): File "/memdisk/autobuild/fl/b1782183/samba/source4/dsdb/tests/python/notification.py", line 181, in test_max_search self.assertEquals(num, ERR_TIME_LIMIT_EXCEEDED) AssertionError: 11 != 3 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andrew Bartlett
parent
0b500d413c
commit
1a315bec27
@ -168,6 +168,8 @@ delete: otherLoginWorkstations
|
||||
attrs=["name"],
|
||||
controls=["notification:1"],
|
||||
timeout=1)
|
||||
num_admin_limit = 0
|
||||
num_time_limit = 0
|
||||
for i in xrange(0, max_notifications + 1):
|
||||
try:
|
||||
for msg in notifies[i]:
|
||||
@ -175,10 +177,15 @@ delete: otherLoginWorkstations
|
||||
res = notifies[i].result()
|
||||
self.fail()
|
||||
except LdbError, (num, _):
|
||||
if i >= max_notifications:
|
||||
self.assertEquals(num, ERR_ADMIN_LIMIT_EXCEEDED)
|
||||
else:
|
||||
self.assertEquals(num, ERR_TIME_LIMIT_EXCEEDED)
|
||||
if num == ERR_ADMIN_LIMIT_EXCEEDED:
|
||||
num_admin_limit += 1
|
||||
continue
|
||||
if num == ERR_TIME_LIMIT_EXCEEDED:
|
||||
num_time_limit += 1
|
||||
continue
|
||||
raise
|
||||
self.assertEqual(num_admin_limit, 1)
|
||||
self.assertEqual(num_time_limit, max_notifications)
|
||||
|
||||
def test_invalid_filter(self):
|
||||
"""Testing invalid filters for notifications"""
|
||||
|
Reference in New Issue
Block a user