mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
We would sometimes see the auth_log test hang during a CI run. The CI job would eventually fail after consuming a costly 10 hours of CI runtime. We believe the problem is around the test creating multiple instances of the Messaging() context. This is a similar race condition to what was seen in 19f34b2161dee26. Currently a new Messaging() context is created for every test case. By using classmethods instead, the Messaging context is only created once per python test file execution (i.e. creation of the python class, rather than initialization of the python object, which happens for every test-case). This means the test will only create one Messaging() context, which should avoid any race conditions. Changes: + removed msg_ctxs - this wasn't actually used for anything. + use classmethods to setup and tear-down the Messaging() context (and tweak lp initialization accordingly). + fix discardMessages() - the loop wasn't actually discarding any messages previously (this may also have been the cause of the test hanging). Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Tue Mar 5 13:10:43 UTC 2019 on sn-devel-144