diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-08-21 21:45:31 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-08-23 07:50:00 +0100 |
commit | f2288adb579de09a1a638514b204d3d8160c43d2 (patch) | |
tree | 4ba20d2a677455a5e3a9680cab97ae54581caca7 /meta/lib | |
parent | c2e589ee0d0a40e4d79c0c7afa8a52693e0b39d7 (diff) | |
download | poky-f2288adb579de09a1a638514b204d3d8160c43d2.tar.gz |
oeqa/context: Only set buffer mode for non-concurrent tests
Periodically we'd see:
NOTE: core-image-sato-1.0-r0 do_testsdk: ======================================================================
NOTE: core-image-sato-1.0-r0 do_testsdk: ERROR: broken-runner
NOTE: core-image-sato-1.0-r0 do_testsdk: ----------------------------------------------------------------------
NOTE: core-image-sato-1.0-r0 do_testsdk: testtools.testresult.real._StringException: Traceback (most recent call last):
File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/meta/lib/oeqa/core/utils/concurrencytest.py", line 122, in _run_test
test.run(process_result)
File "/usr/lib/python3.6/site-packages/subunit/__init__.py", line 1194, in run
protocol = TestProtocolServer(result, self._passthrough, self._forward)
File "/usr/lib/python3.6/site-packages/subunit/__init__.py", line 514, in __init__
stream = stream.buffer
AttributeError: '_io.StringIO' object has no attribute 'buffer'
which seems to occur if a result arrives before all the runner threads
have started. The runner's result handling changes sys.stdout to a buffer
temporarily which can be seen in other threads and it can sometimes fail.
Since the tests are running in a separate process we don't need this buffer
handling in the concurrent case so only set when not parallelising. The
concurrent class handle setting buffer mode internally.
(From OE-Core rev: e2c66aa0f74d19fbc7e56af1fb440ad6473d3a8e)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/core/context.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/lib/oeqa/core/context.py b/meta/lib/oeqa/core/context.py index f174c4bbcf..821aec8836 100644 --- a/meta/lib/oeqa/core/context.py +++ b/meta/lib/oeqa/core/context.py | |||
@@ -58,7 +58,7 @@ class OETestContext(object): | |||
58 | self.suites = self.loader.discover() | 58 | self.suites = self.loader.discover() |
59 | 59 | ||
60 | def runTests(self, processes=None, skips=[]): | 60 | def runTests(self, processes=None, skips=[]): |
61 | self.runner = self.runnerClass(self, descriptions=False, verbosity=2, buffer=True) | 61 | self.runner = self.runnerClass(self, descriptions=False, verbosity=2) |
62 | 62 | ||
63 | # Dinamically skip those tests specified though arguments | 63 | # Dinamically skip those tests specified though arguments |
64 | self.skipTests(skips) | 64 | self.skipTests(skips) |
@@ -70,6 +70,7 @@ class OETestContext(object): | |||
70 | concurrent_suite = ConcurrentTestSuite(self.suites, processes) | 70 | concurrent_suite = ConcurrentTestSuite(self.suites, processes) |
71 | result = self.runner.run(concurrent_suite) | 71 | result = self.runner.run(concurrent_suite) |
72 | else: | 72 | else: |
73 | self.runner.buffer = True | ||
73 | result = self.runner.run(self.suites) | 74 | result = self.runner.run(self.suites) |
74 | self._run_end_time = time.time() | 75 | self._run_end_time = time.time() |
75 | 76 | ||