Skip to content
Snippets Groups Projects
Commit a42b5d68 authored by Brad Payne (Vir Linden)'s avatar Brad Payne (Vir Linden)
Browse files

SL-15999 - made cwd handling a bit more robust in perfbot_run.py

parent e5cd9cb9
Branches
Tags
1 merge request!83Merge Linden 6.6.7
...@@ -75,12 +75,12 @@ def gen_niv_script(args): ...@@ -75,12 +75,12 @@ def gen_niv_script(args):
# you can also specify it explicitly with the --cwd parameter # you can also specify it explicitly with the --cwd parameter
# (required for dev builds) # (required for dev builds)
args.viewer = os.path.abspath(args.viewer) args.viewer = os.path.abspath(args.viewer)
working_dir = args.cwd
if len(args.cwd) == 0: if len(args.cwd) == 0:
working_dir = os.path.dirname(os.path.abspath(args.viewer)) working_dir = os.path.dirname(os.path.abspath(args.viewer))
print(f"Working directory is {working_dir} {args.cwd=}") else:
environ = os.environ working_dir = os.path.abspath(args.cwd)
environ["cwd"] = working_dir print(f"Working directory is {working_dir}, cwd {args.cwd}")
os.chdir(working_dir)
if args.dryrun: if args.dryrun:
print("Running in dry-run mode - no Viewers will be started") print("Running in dry-run mode - no Viewers will be started")
...@@ -138,7 +138,7 @@ def gen_niv_script(args): ...@@ -138,7 +138,7 @@ def gen_niv_script(args):
# usefully, display the script lines) but do not start the Viewer # usefully, display the script lines) but do not start the Viewer
if args.dryrun == False: if args.dryrun == False:
print("opening viewer session with",script_cmd) print("opening viewer session with",script_cmd)
viewer_session = subprocess.Popen(script_cmd,env=environ) viewer_session = subprocess.Popen(script_cmd)
# Sleeping a bit between launches seems to help avoid a CPU # Sleeping a bit between launches seems to help avoid a CPU
# surge when N Viewers are started simulatanously. The default # surge when N Viewers are started simulatanously. The default
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment