diff --git a/tests/gold_tests/logging/sigusr2.test.py b/tests/gold_tests/logging/sigusr2.test.py index 397119ab2b5..b339bbbc260 100644 --- a/tests/gold_tests/logging/sigusr2.test.py +++ b/tests/gold_tests/logging/sigusr2.test.py @@ -130,9 +130,9 @@ def get_sigusr2_signal_command(self): # Configure the signaling of SIGUSR2 to traffic_server. tr1.Processes.Default.Command = diags_test.get_sigusr2_signal_command() tr1.Processes.Default.Return = 0 -tr1.Processes.Default.Ready = When.FileExists(diags_test.diags_log) - -# Configure process order. +# Configure process order: ts starts first, then rotate moves diags.log, +# then Default sends SIGUSR2. No Ready condition needed on Default since the +# StartBefore chain already ensures ts is fully started before rotate runs. tr1.Processes.Default.StartBefore(rotate_diags_log) rotate_diags_log.StartBefore(diags_test.ts) tr1.StillRunningAfter = diags_test.ts diff --git a/tests/gold_tests/thread_config/check_threads.py b/tests/gold_tests/thread_config/check_threads.py index 1a7de52cb92..e0347b7dddc 100755 --- a/tests/gold_tests/thread_config/check_threads.py +++ b/tests/gold_tests/thread_config/check_threads.py @@ -36,13 +36,16 @@ def _count_threads_once(ts_path, etnet_threads, accept_threads, task_threads, ai # Find the pid corresponding to the ats process we started in autest. # It needs to match the process name and the binary path. # If autest can expose the pid of the process this is not needed anymore. + # Match by CWD or command line containing ts_path, since under + # ASAN the CWD may differ from the expected path. process_name = p.name() process_cwd = p.cwd() process_exe = p.exe() - if process_cwd != ts_path: - continue - if process_name != '[TS_MAIN]' and process_name != 'traffic_server' and os.path.basename( - process_exe) != 'traffic_server': + is_ts = process_name == '[TS_MAIN]' or process_name == 'traffic_server' or os.path.basename( + process_exe) == 'traffic_server' + match_by_cwd = process_cwd == ts_path + match_by_cmdline = any(ts_path in arg for arg in (p.cmdline() or [])) + if not is_ts or not (match_by_cwd or match_by_cmdline): continue except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): continue diff --git a/tests/gold_tests/timeout/ssl-delay-server.cc b/tests/gold_tests/timeout/ssl-delay-server.cc index d993696229e..93c867f7b5b 100644 --- a/tests/gold_tests/timeout/ssl-delay-server.cc +++ b/tests/gold_tests/timeout/ssl-delay-server.cc @@ -39,6 +39,7 @@ #include #include #include +#include char req_buf[10000]; char post_buf[1000]; @@ -156,6 +157,10 @@ main(int argc, char *argv[]) ttfb_delay = atoi(argv[3]); const char *pem_file = argv[4]; + // Ignore SIGPIPE which can be raised when a client disconnects during + // the handshake delay, killing the process unexpectedly. + signal(SIGPIPE, SIG_IGN); + fprintf(stderr, "Listen on %d connect delay=%d ttfb delay=%d\n", listen_port, connect_delay, ttfb_delay); int listenfd = socket(AF_INET, SOCK_STREAM, 0); @@ -199,8 +204,10 @@ main(int argc, char *argv[]) for (;;) { sfd = accept(listenfd, (struct sockaddr *)nullptr, nullptr); if (sfd <= 0) { - // Failure - printf("Listen failure\n"); + if (errno == EINTR) { + continue; + } + printf("Listen failure errno=%d\n", errno); exit(1); }