aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Rossi <nathan.rossi@xilinx.com>2015-04-16 18:29:24 +1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-21 07:19:05 +0100
commita44d27b92baba4ab51f432ec01cdc473436ce406 (patch)
treea1167e8d9c490c6028addb901437821451866b25
parentfbe6d2c12aa9f7956bc87efeb68cb64b26b60c7a (diff)
downloadopenembedded-core-contrib-a44d27b92baba4ab51f432ec01cdc473436ce406.tar.gz
oeqa/utils/decorators: Fix up frame selection
Use threading to get the current threads ident to select the current executing frame to ensure that the scanned stack is the expected stack. This allows for the decorators to be used within a process that has multiple threads executing. Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/utils/decorators.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/decorators.py b/meta/lib/oeqa/utils/decorators.py
index 1e5a890fdd..61a1a739ea 100644
--- a/meta/lib/oeqa/utils/decorators.py
+++ b/meta/lib/oeqa/utils/decorators.py
@@ -10,12 +10,14 @@ import os
import logging
import sys
import unittest
+import threading
#get the "result" object from one of the upper frames provided that one of these upper frames is a unittest.case frame
class getResults(object):
def __init__(self):
#dynamically determine the unittest.case frame and use it to get the name of the test method
- upperf = sys._current_frames().values()[0]
+ ident = threading.current_thread().ident
+ upperf = sys._current_frames()[ident]
while (upperf.f_globals['__name__'] != 'unittest.case'):
upperf = upperf.f_back