Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/gold_tests/logging/sigusr2.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment on lines +133 to 137
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says the StartBefore chain ensures TS is "fully started", but StartBefore only enforces launch ordering; it doesn’t guarantee diags.log exists before mv runs. With the Ready condition removed from Default, rotate_diags_log can still race TS startup and fail if diags.log hasn’t been created yet. Consider moving the file-exists gating to the rotate step (e.g., via a ready= condition on the StartBefore edge or by making the rotate command wait/retry) and/or adjust the comment to avoid implying readiness guarantees.

Copilot uses AI. Check for mistakes.
tr1.StillRunningAfter = diags_test.ts
Expand Down
11 changes: 7 additions & 4 deletions tests/gold_tests/thread_config/check_threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions tests/gold_tests/timeout/ssl-delay-server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <sys/time.h>
#include <sys/select.h>
#include <cerrno>
#include <csignal>

char req_buf[10000];
char post_buf[1000];
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -199,8 +204,10 @@ main(int argc, char *argv[])
for (;;) {
sfd = accept(listenfd, (struct sockaddr *)nullptr, nullptr);
if (sfd <= 0) {
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accept() returns -1 on error, but can legally return fd 0 on success (e.g., if stdin is closed). The if (sfd <= 0) check will treat a valid connection as failure and exit, potentially reintroducing flakiness. Use sfd < 0 for the error check, keeping the EINTR retry logic the same.

Suggested change
if (sfd <= 0) {
if (sfd < 0) {

Copilot uses AI. Check for mistakes.
// Failure
printf("Listen failure\n");
if (errno == EINTR) {
continue;
}
printf("Listen failure errno=%d\n", errno);
exit(1);
}

Expand Down
Loading