Skip to content

Commit e13f239

Browse files
authored
test(data-pipeline): handle EINTR in test_health_metrics_disabled (#1430)
test(data-pipeline): handle EINTR in test_health_metrics_disabled Handle ErrorKind::Interrupted alongside WouldBlock/TimedOut when reading from socket. Signals can interrupt the blocking recvfrom() syscall, causing EINTR instead of timeout. Fixes intermittent CI test failure. Co-authored-by: levi.morrison <levi.morrison@datadoghq.com>
1 parent 9508161 commit e13f239

File tree

1 file changed

+6
-3
lines changed
  • libdd-data-pipeline/src/trace_exporter

1 file changed

+6
-3
lines changed

libdd-data-pipeline/src/trace_exporter/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,10 +1464,13 @@ mod tests {
14641464
}
14651465
Err(e)
14661466
if e.kind() == std::io::ErrorKind::WouldBlock
1467-
|| e.kind() == std::io::ErrorKind::TimedOut =>
1467+
|| e.kind() == std::io::ErrorKind::TimedOut
1468+
|| e.kind() == std::io::ErrorKind::Interrupted =>
14681469
{
1469-
// This is expected - no metrics should be sent when disabled
1470-
// WouldBlock on Unix, TimedOut on Windows
1470+
// This is expected - no metrics should be sent when disabled.
1471+
// WouldBlock on Unix, TimedOut on Windows.
1472+
// Interrupted can occur when signals interrupt the blocking
1473+
// recvfrom() syscall before the timeout expires.
14711474
}
14721475
Err(e) => panic!("Unexpected error reading from socket: {e}"),
14731476
}

0 commit comments

Comments
 (0)