Skip to content
Merged
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
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
13 changes: 10 additions & 3 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 @@ -198,9 +203,11 @@ main(int argc, char *argv[])

for (;;) {
sfd = accept(listenfd, (struct sockaddr *)nullptr, nullptr);
if (sfd <= 0) {
// Failure
printf("Listen failure\n");
if (sfd < 0) {
if (errno == EINTR) {
continue;
}
printf("Listen failure errno=%d\n", errno);
exit(1);
}

Expand Down