Updated openstack/openstack
Project: openstack/trove  f2efdcc29b080f9859d041ee1e87399f04086471

Correct monkey patching in GuestAgentBackupTest

This change addresses some intermittent failures in tests that we've
been seeing recently.

The failure would typically manifest itself in
test_prepare_from_backup test in test_mongodb_manager.py but in theory
it could occur elsewhere. The good thing about this change is that it
will make the intermittent failures persistent. But, thanks to the fix
for bug 1353570 (change I22d839f) the failures won't happen any
longer.

This change, without the earlier change for bug 1353570 did in fact
serve to make the intermittent failures permanent. The issue is that
GuestAgentBackupTest didn't unpatch execute_with_timeout when it was
done. This meant that tests running after it were running in an
environment where execute_with_timeout was patched. But, just in case
you had a test which didn't itself patch execute_with_timeout and it
happened to run on a thread that hadn't run GuestAgentBackupTest,
you'd get a bad result.

The fix is to include code to save and restore execute_with_timeout in
setUp and tearDown.

Change-Id: I60187145d25524b4e7614d5d8cce9027521db44c
Closes-Bug: #1347337