mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
tests/dbus-runner: Make sure to tear-down even on test failure
When a test failed, an exception would be raised. This meant that the mocked service would stay alive, and the test case being run eventually failing due to a timeout, not the failure itself. Fix this by catching the exception during the test, ensuring that we tear down properly, then re-raise the same exception again after having teared down. This avoids the dead lock, while still printing the appropriate error message. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2008>
This commit is contained in:
parent
fca9010963
commit
1031de5605
@ -122,5 +122,7 @@ if __name__ == '__main__':
|
||||
MutterDBusTestCase.setUpClass()
|
||||
test_case = MutterDBusTestCase()
|
||||
test_case.assertGreater(len(sys.argv), 1)
|
||||
test_case.wrap_call(sys.argv[1:])
|
||||
MutterDBusTestCase.tearDownClass()
|
||||
try:
|
||||
test_case.wrap_call(sys.argv[1:])
|
||||
finally:
|
||||
MutterDBusTestCase.tearDownClass()
|
||||
|
Loading…
Reference in New Issue
Block a user