From f0fe2f924db95442ff3efe509f01382c1f48fe11 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Thu, 14 Jul 2022 09:48:13 -0500 Subject: SERVER-65508 detect existing resmoke processes which could cause issues for tests --- buildscripts/resmokelib/core/process.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'buildscripts/resmokelib/core') diff --git a/buildscripts/resmokelib/core/process.py b/buildscripts/resmokelib/core/process.py index 1e22aa532a3..f4517aa6cef 100644 --- a/buildscripts/resmokelib/core/process.py +++ b/buildscripts/resmokelib/core/process.py @@ -89,7 +89,14 @@ class Process(object): self.logger = logger self.args = args + self.env = utils.default_if_none(env, os.environ.copy()) + if not self.env.get('RESMOKE_PARENT_PROCESS'): + self.env['RESMOKE_PARENT_PROCESS'] = os.environ.get('RESMOKE_PARENT_PROCESS', + str(os.getpid())) + if not self.env.get('RESMOKE_PARENT_CTIME'): + self.env['RESMOKE_PARENT_CTIME'] = os.environ.get('RESMOKE_PARENT_CTIME', + str(psutil.Process().create_time())) if env_vars is not None: self.env.update(env_vars) -- cgit v1.2.1