Signal handler used by alarm() to abort the test if it hangs */
| 20156 | |
| 20157 | /* Signal handler used by alarm() to abort the test if it hangs */ |
| 20158 | static void alarm_handler(int sig) { |
| 20159 | (void)sig; |
| 20160 | /* Writing to stderr is async-signal-safe */ |
| 20161 | const char msg[] = "FAIL: mcp_server_run_rapid_messages timed out (>5s)\n"; |
| 20162 | write(STDERR_FILENO, msg, sizeof(msg) - 1); |
| 20163 | _exit(1); |
| 20164 | } |
| 20165 | |
| 20166 | TEST(mcp_server_run_rapid_messages) { |
| 20167 | /* Simulate a client sending initialize + notifications/initialized + |