updating test_analyze_commands test configuration to be thread safe

for parallel execution; done via use of setup_workload_dir() which
copies contents into unique directory path; no change if running serially

Signed-off-by: Karl W Schulz <karl.schulz@amd.com>


[ROCm/rocprofiler-compute commit: 30d75066b9]
Dieser Commit ist enthalten in:
Karl W Schulz verfasst und Karl W. Schulz committed 2024-03-15 14:04:49 -05:00
1 Ursprung 104bf46b4b
Commit a4b6ce2f01
2 Dateien geändert
+265 -98

Keine Dateien entsprechen Ihrer Suche

Datei-Diff unterdrückt, da er zu groß ist. Diff laden
@@ -66,6 +66,25 @@ def get_output_dir(suffix="_output", clean_existing=True):
return output_dir
def setup_workload_dir(input_dir, suffix="_tmp", clean_existing=True):
"""Provides a unique input workoad directory with contents of input_dir
based on the name of the calling test function.
Setup is a NOOP when tests run serially.
"""
if "PYTEST_XDIST_WORKER_COUNT" not in os.environ:
return input_dir
output_dir = inspect.stack()[1].function + suffix
if clean_existing:
if os.path.exists(output_dir):
shutil.rmtree(output_dir)
shutil.copytree(input_dir, output_dir)
return output_dir
def clean_output_dir(cleanup, output_dir):
"""Remove output directory generated from omniperf execution