summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core/tests/test_decorators.py
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2021-04-20 19:32:59 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-23 10:10:43 +0100
commit54ef07a9aa1af8f41cfb9a4802929c918efc43c8 (patch)
tree8754d0e0002bf813dfdcdfc067c9f7d68dad9bfc /meta/lib/oeqa/core/tests/test_decorators.py
parentf42a08e1aabf1ca57e0c09d69fb69cc717c7f156 (diff)
downloadopenembedded-core-contrib-54ef07a9aa1af8f41cfb9a4802929c918efc43c8.tar.gz
meta/lib/oeqa/core/tests/cases/timeout.py: add a testcase for the previous fix
This is the sequence that didn't properly operate: - a test case that skips and isn't executed - a second test case that is skipped via a dependency decorator, and sets a timeout - a third test case that takes longer than the timeout from the second test case Without the fix, the timeout is not cleared, and the third test case is erroneously aborted. With the fix, the timeout is cleared and the third test case is able to complete. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/core/tests/test_decorators.py')
-rwxr-xr-xmeta/lib/oeqa/core/tests/test_decorators.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/tests/test_decorators.py b/meta/lib/oeqa/core/tests/test_decorators.py
index b798bf7d33..5095f39948 100755
--- a/meta/lib/oeqa/core/tests/test_decorators.py
+++ b/meta/lib/oeqa/core/tests/test_decorators.py
@@ -133,5 +133,11 @@ class TestTimeoutDecorator(TestBase):
msg = "OETestTimeout didn't restore SIGALRM"
self.assertIs(alarm_signal, signal.getsignal(signal.SIGALRM), msg=msg)
+ def test_timeout_cancel(self):
+ tests = ['timeout.TimeoutTest.testTimeoutSkip', 'timeout.TimeoutTest.testTimeoutDepends', 'timeout.TimeoutTest.testTimeoutUnrelated']
+ msg = 'Unrelated test failed to complete'
+ tc = self._testLoader(modules=self.modules, tests=tests)
+ self.assertTrue(tc.runTests().wasSuccessful(), msg=msg)
+
if __name__ == '__main__':
unittest.main()