Once XDesktop.terminate is called, there is a race condition where if
the termination completes before the truthiness of the context is
checked then it will end up checking on a disposed object and the test
will fail. The check for truthiness ends up calling __len__ on the UNO
wrapper which tries to query some interfaces on the object. This might
be the cause of some failures on Jenkins. I can replicate it if I put a
short sleep after calling terminate. This patch just makes it check the
truthiness immediately instead of waiting until after terminate is
called.
Change-Id: I41f93ca15a52dd45fc304dfd7d4c6d954ca26e42
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208225
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins