From a81d87b69f1490881f56e79d624602f53fc0de89 Mon Sep 17 00:00:00 2001 From: bneradt Date: Wed, 20 May 2026 11:48:27 -0500 Subject: [PATCH] Stabilize parallel AuTest helpers Parallel AuTest runs can execute redirect and redirect_actions at the same time. Both tests wrote request files into the same generated data directory, so one test could overwrite the other's inputs and make redirect fail with unrelated redirect_actions requests. This gives each redirect test its own generated-data directory and keeps those directories ignored. This also makes the SIGUSR2 helper tolerate processes whose psutil cmdline is unavailable, so process scanning does not crash before signaling Traffic Server. --- tests/gold_tests/logging/ts_process_handler.py | 5 ++++- tests/gold_tests/redirect/.gitignore | 3 ++- tests/gold_tests/redirect/redirect.test.py | 2 +- tests/gold_tests/redirect/redirect_actions.test.py | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/gold_tests/logging/ts_process_handler.py b/tests/gold_tests/logging/ts_process_handler.py index ec1bcd469f1..40640e3922e 100644 --- a/tests/gold_tests/logging/ts_process_handler.py +++ b/tests/gold_tests/logging/ts_process_handler.py @@ -36,7 +36,10 @@ def __init__(self, message): def get_ts_process_pid(ts_identifier): processes = [] for proc in psutil.process_iter(['cmdline']): - commandline = ' '.join(proc.info['cmdline']) + cmdline = proc.info.get('cmdline', []) + if not cmdline: + continue + commandline = ' '.join(cmdline) if '/traffic_server' in commandline and ts_identifier in commandline: return proc raise GetPidError("Could not find a traffic_server process") diff --git a/tests/gold_tests/redirect/.gitignore b/tests/gold_tests/redirect/.gitignore index 90b27be0804..664b6818dc3 100644 --- a/tests/gold_tests/redirect/.gitignore +++ b/tests/gold_tests/redirect/.gitignore @@ -1 +1,2 @@ -generated_test_data/ +redirect_actions_generated_test_data/ +redirect_generated_test_data/ diff --git a/tests/gold_tests/redirect/redirect.test.py b/tests/gold_tests/redirect/redirect.test.py index 6e9d92aaf3f..1a14ed1d974 100644 --- a/tests/gold_tests/redirect/redirect.test.py +++ b/tests/gold_tests/redirect/redirect.test.py @@ -69,7 +69,7 @@ dns.addRecords(records={"iwillredirect.test": ["127.0.0.1"]}) -data_dirname = 'generated_test_data' +data_dirname = 'redirect_generated_test_data' data_path = os.path.join(Test.TestDirectory, data_dirname) os.makedirs(data_path, exist_ok=True) diff --git a/tests/gold_tests/redirect/redirect_actions.test.py b/tests/gold_tests/redirect/redirect_actions.test.py index 52a036bd61f..beaeae1bebc 100644 --- a/tests/gold_tests/redirect/redirect_actions.test.py +++ b/tests/gold_tests/redirect/redirect_actions.test.py @@ -92,7 +92,7 @@ # Map scenarios to trafficserver processes. trafficservers = {} -data_dirname = 'generated_test_data' +data_dirname = 'redirect_actions_generated_test_data' data_path = os.path.join(Test.TestDirectory, data_dirname) os.makedirs(data_path, exist_ok=True)