diff options
author | Simon Glass <sjg@chromium.org> | 2021-04-07 16:53:23 +1200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-07 20:19:31 +0000 |
commit | e8d4831bd75804cc63c679204719dcd163c2637d (patch) | |
tree | c958b5aac4cb1813003dc3e7b3cd8cc2ee544878 /zephyr/zmake/zmake/multiproc.py | |
parent | 2867193866966106225b19a3b7d5d18ba43489e8 (diff) | |
download | chrome-ec-e8d4831bd75804cc63c679204719dcd163c2637d.tar.gz |
zephyr: zmake: Reset the multiproc module before use
At present the logging map from one test can still be around for a
following tests. This can cause strange behaviour.
Add a reset() function to help with this. Call it from the Zmake
constructor which is used by any test which cares about this.
BUG=b:177096315
BRANCH=none
TEST=with other CLs, see that the tests pass when all run together
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I0bf112e705c6badd3958a0afba8a3761e95fa547
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809780
Reviewed-by: Yuval Peress <peress@chromium.org>
Diffstat (limited to 'zephyr/zmake/zmake/multiproc.py')
-rw-r--r-- | zephyr/zmake/zmake/multiproc.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/zephyr/zmake/zmake/multiproc.py b/zephyr/zmake/zmake/multiproc.py index 68fc086e69..966d90c567 100644 --- a/zephyr/zmake/zmake/multiproc.py +++ b/zephyr/zmake/zmake/multiproc.py @@ -24,6 +24,13 @@ _logging_cv = threading.Condition() _logging_map = {} +def reset(): + """Reset this module to its starting state (useful for tests)""" + global _logging_map + + _logging_map = {} + + class LogWriter: """Contains information about a file descriptor that is producing output |