diff options
author | Jürg Billeter <j@bitron.ch> | 2019-08-30 09:50:13 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-08-30 09:50:13 +0200 |
commit | a1986816fa83ac4a7c2bff85fd4f86c2437e51de (patch) | |
tree | 010f536949b49adfe287056b064ea620c7302a15 | |
parent | 173fe772eb06542a23e8c48b22aab791c6363bdb (diff) | |
download | buildstream-juerg/test-in-subprocess.tar.gz |
_context.py: Don't disable fork in the main test processjuerg/test-in-subprocess
The main test process may be used for further tests that may use fork
and thus, fork cannot be disabled. This is a safeguard against hanging
tests.
-rw-r--r-- | src/buildstream/_context.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/buildstream/_context.py b/src/buildstream/_context.py index c6cde4003..a4fe6f509 100644 --- a/src/buildstream/_context.py +++ b/src/buildstream/_context.py @@ -496,6 +496,11 @@ class Context(): # with casd in the main process. # def disable_fork(self): + # Can't permanently disable fork in the main test process as the process + # may be used for further tests that may use fork. + if self.is_running_in_test_suite and 'BST_TEST_SUITE_FORKED' not in os.environ: + return + self.fork_allowed = False cascache = self.get_cascache() cascache.notify_fork_disabled() |