From d85e5b80290192703cd5f967245ca257c2163cc4 Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Mon, 19 Nov 2018 13:39:29 +0000 Subject: [PATCH] Fix functional tests timeout race condition The test_idl_run_exception_terminates test sometimes fails in the gate with the following error; ovsdbapp.exceptions.TimeoutException: Commands [] exceeded timeout 1 seconds This seems to be due to another test called test_post_commit_vswitchd_incomplete_timeout setting the transaction timeout to 1 second. If the tests runs concurrently there's a chance that such change would also affect the other tests. This patch is changing the way that we force a timeout for the test_post_commit_vswitchd_incomplete_timeout test by mocking the timeout_exceed() method to return True within the scope of that patch only. Change-Id: I3f391f0b80285a2418987e2c51985732fa2cc352 Signed-off-by: Lucas Alvares Gomes --- ovsdbapp/tests/functional/schema/open_vswitch/test_impl_idl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ovsdbapp/tests/functional/schema/open_vswitch/test_impl_idl.py b/ovsdbapp/tests/functional/schema/open_vswitch/test_impl_idl.py index 7b9d6107..cac5c855 100644 --- a/ovsdbapp/tests/functional/schema/open_vswitch/test_impl_idl.py +++ b/ovsdbapp/tests/functional/schema/open_vswitch/test_impl_idl.py @@ -197,5 +197,6 @@ class ImplIdlTestCase(base.FunctionalTestCase): def test_post_commit_vswitchd_incomplete_timeout(self, *args): # Due to timing issues we may rarely hit the global timeout, which # raises RuntimeError to match the vsctl implementation - self.api.ovsdb_connection.timeout = 1 + mock.patch('ovsdbapp.backend.ovs_idl.transaction.' + 'Transaction.timeout_exceeded', return_value=True).start() self.assertRaises((exc.TimeoutException, RuntimeError), self._add_br)