mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
81043cdf0e
Some tests (especially samba.tests.auth_log_netlogon_bad_creds) are failing due to not receiving expected messages. There seems to be some timing issue or race around the messaging bus being set up and getting the expected events resulting from the failed netlogon. Specifically the the order of destruction of the messaging.Messaging() c-py objects is different under python2. Under python2 all of the messaging.Messaging() objects are destructed *after* all the tests are run. Note: each instance of the TestCase has it's own Messaging() instance which is created by TestCaseXYZ.setUp, so it appears the unittest destroys the test instances when all the tests have run whereas in python3 we see each messaging.Messaging() instance destroyed after each test runs. Ok, what difference does that make ? well it seems in python3 because each Messaging() instance is destructed after a test runs that the associated messaging_dgm_destroy() also runs, this destroys the global_dgm_context context which means when the next test runs the whole messaging infrastructure needs to be built again when the next Messaging() object is created. On the server-side this seems to result in attempts to send messages to the listener failing first with get_event_server: Failed to find 'auth_event' registered on the message bus to send JSON audit events to: NT_STATUS_CONNECTION_REFUSED and subsequently with get_event_server: Failed to find 'auth_event' registered on the message bus to send JSON audit events to: NT_STATUS_UNSUCCESSFUL client doesn't get any more messages, test fails :-( So, what's the difference in python2, well because the destructors for the (4 in the case of netlogon_bad_creds) instances of Messagaging() don't run till the end of the tests this doesn't happen and the global_dgm_context never gets destroyed untill all the tests complete. There is some race condition at play here, a simple sleep at the start of a failing test fixes the problem. But... ok that isn't a possible solution here, instead I have adjusted the base auth tests to store the Messaging() objects in a global list forcing them to remain in scope until the tests are complete. This ensure the behaviour is consistent across python2 & python3. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> |
||
---|---|---|
.. | ||
emulate | ||
gp_parse | ||
kcc | ||
netcmd | ||
provision | ||
samba3 | ||
subunit | ||
tests | ||
web_server | ||
__init__.py | ||
colour.py | ||
common.py | ||
compat.py | ||
dbchecker.py | ||
descriptor.py | ||
dnsserver.py | ||
domain_update.py | ||
drs_utils.py | ||
forest_update.py | ||
getopt.py | ||
gp_ext_loader.py | ||
gp_sec_ext.py | ||
gpclass.py | ||
graph.py | ||
hostconfig.py | ||
idmap.py | ||
join.py | ||
logger.py | ||
mdb_util.py | ||
ms_display_specifiers.py | ||
ms_forest_updates_markdown.py | ||
ms_schema_markdown.py | ||
ms_schema.py | ||
ndr.py | ||
ntacls.py | ||
remove_dc.py | ||
samdb.py | ||
schema.py | ||
sd_utils.py | ||
sites.py | ||
subnets.py | ||
tdb_util.py | ||
upgrade.py | ||
upgradehelpers.py | ||
uptodateness.py | ||
xattr.py |