[PATCHES] two small patches
Douglas Bagnall
douglas.bagnall at catalyst.net.nz
Fri Feb 9 03:49:26 UTC 2018
Whilst chasing a flapping test, I tried to run it in a loop in a
testenv, like this:
for i in {1..200}; do
echo $i
time python -m samba.subunit.run \
samba.tests.samba_tool.user_wdigest || break
done
and I noticed two things: it got slower and slower, and it never failed
at the process level even when I put in deliberate failures.
The slower and slower part is addressed by the first patch. This test
adds and deletes the same user 30 times while the loop above runs the
test 200 times. That adds the same user 6000 times. Currently the
newuser() code ends up searching for the user using samaccountname, but
samaccountname is retained on deleted objects, so the index ends up
finding 6000 users. If we search instead using the DN it is quicker.
The test never failed because of a bug in our TestRunner class, which
does not look after the wasSuccessful() method it inherited from
unittest.TestRunner.
Douglas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: misc.patch
Type: text/x-patch
Size: 3328 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20180209/0139e8ca/misc.bin>
More information about the samba-technical
mailing list