summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core/decorator
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-12 11:10:38 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-18 10:18:41 +0100
commit4e4958cba2e083eac20e2770e04bfc7d56d9db42 (patch)
treeb8fb57f9b3a3e37b3a5f095c70c127af9bce82fa /meta/lib/oeqa/core/decorator
parentebd97e728ae1bd9442299c871a07a1b3b9f9efdf (diff)
downloadpoky-4e4958cba2e083eac20e2770e04bfc7d56d9db42.tar.gz
oeqa/core/threaded: Remove in favour of using concurrenttests
We have several options for parallel processing in oeqa, parallel execution of modules, threading and mulitple processes for the runners. After much experimentation is appears the most scalable and least invasive approach is multiple processes using concurrenttestsuite from testtools. This means we can drop the current threading code which is only used by the sdk test execution. oeqa/decorator/depends: Remove threading code Revert "oeqa/sdk: Enable usage of OEQA thread mode" This reverts commit adc434c0636b7dea2ef70c8d2c8e61cdb5c703b1. Revert "oeqa/core/tests: Add tests of OEQA Threaded mode" This reverts commit a4eef558c9933eb32413b61ff80a11b999951b40. Revert "oeqa/core/decorator/oetimeout: Add support for OEQA threaded mode" This reverts commit d3d4ba902dee8b19fa1054330cffdf73f9b81fe7. (From OE-Core rev: a98ab5e560e73b6988512fbae5cefe9e42ceed53) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/core/decorator')
-rw-r--r--meta/lib/oeqa/core/decorator/depends.py7
-rw-r--r--meta/lib/oeqa/core/decorator/oetimeout.py40
2 files changed, 11 insertions, 36 deletions
diff --git a/meta/lib/oeqa/core/decorator/depends.py b/meta/lib/oeqa/core/decorator/depends.py
index baa04341c7..99eccc1268 100644
--- a/meta/lib/oeqa/core/decorator/depends.py
+++ b/meta/lib/oeqa/core/decorator/depends.py
@@ -3,7 +3,6 @@
3 3
4from unittest import SkipTest 4from unittest import SkipTest
5 5
6from oeqa.core.threaded import OETestRunnerThreaded
7from oeqa.core.exception import OEQADependency 6from oeqa.core.exception import OEQADependency
8 7
9from . import OETestDiscover, registerDecorator 8from . import OETestDiscover, registerDecorator
@@ -64,11 +63,7 @@ def _order_test_case_by_depends(cases, depends):
64 return [cases[case_id] for case_id in cases_ordered] 63 return [cases[case_id] for case_id in cases_ordered]
65 64
66def _skipTestDependency(case, depends): 65def _skipTestDependency(case, depends):
67 if isinstance(case.tc.runner, OETestRunnerThreaded): 66 results = case.tc._results
68 import threading
69 results = case.tc._results[threading.get_ident()]
70 else:
71 results = case.tc._results
72 67
73 skipReasons = ['errors', 'failures', 'skipped'] 68 skipReasons = ['errors', 'failures', 'skipped']
74 69
diff --git a/meta/lib/oeqa/core/decorator/oetimeout.py b/meta/lib/oeqa/core/decorator/oetimeout.py
index f85e7d9792..a247583f7f 100644
--- a/meta/lib/oeqa/core/decorator/oetimeout.py
+++ b/meta/lib/oeqa/core/decorator/oetimeout.py
@@ -1,12 +1,8 @@
1# Copyright (C) 2016 Intel Corporation 1# Copyright (C) 2016 Intel Corporation
2# Released under the MIT license (see COPYING.MIT) 2# Released under the MIT license (see COPYING.MIT)
3 3
4from . import OETestDecorator, registerDecorator
5
6import signal 4import signal
7from threading import Timer 5from . import OETestDecorator, registerDecorator
8
9from oeqa.core.threaded import OETestRunnerThreaded
10from oeqa.core.exception import OEQATimeoutError 6from oeqa.core.exception import OEQATimeoutError
11 7
12@registerDecorator 8@registerDecorator
@@ -14,32 +10,16 @@ class OETimeout(OETestDecorator):
14 attrs = ('oetimeout',) 10 attrs = ('oetimeout',)
15 11
16 def setUpDecorator(self): 12 def setUpDecorator(self):
17 self.logger.debug("Setting up a %d second(s) timeout" % self.oetimeout) 13 timeout = self.oetimeout
18 14 def _timeoutHandler(signum, frame):
19 if isinstance(self.case.tc.runner, OETestRunnerThreaded): 15 raise OEQATimeoutError("Timed out after %s "
20 self.timeouted = False
21 def _timeoutHandler():
22 self.timeouted = True
23
24 self.timer = Timer(self.oetimeout, _timeoutHandler)
25 self.timer.start()
26 else:
27 timeout = self.oetimeout
28 def _timeoutHandler(signum, frame):
29 raise OEQATimeoutError("Timed out after %s "
30 "seconds of execution" % timeout) 16 "seconds of execution" % timeout)
31 17
32 self.alarmSignal = signal.signal(signal.SIGALRM, _timeoutHandler) 18 self.logger.debug("Setting up a %d second(s) timeout" % self.oetimeout)
33 signal.alarm(self.oetimeout) 19 self.alarmSignal = signal.signal(signal.SIGALRM, _timeoutHandler)
20 signal.alarm(self.oetimeout)
34 21
35 def tearDownDecorator(self): 22 def tearDownDecorator(self):
36 if isinstance(self.case.tc.runner, OETestRunnerThreaded): 23 signal.alarm(0)
37 self.timer.cancel() 24 signal.signal(signal.SIGALRM, self.alarmSignal)
38 self.logger.debug("Removed Timer handler") 25 self.logger.debug("Removed SIGALRM handler")
39 if self.timeouted:
40 raise OEQATimeoutError("Timed out after %s "
41 "seconds of execution" % self.oetimeout)
42 else:
43 signal.alarm(0)
44 signal.signal(signal.SIGALRM, self.alarmSignal)
45 self.logger.debug("Removed SIGALRM handler")