No test coverage for sendfile zero-copy transfer path #71

Closed
opened 2026-07-20 17:14:37 +02:00 by TapTap · 0 comments
Owner

Description

The function in provides zero-copy file transfer using . However, there are no unit tests covering this code path:

  1. No test for sending a file over a pipe
  2. No test for the sendfile path in the client_send pipeline
  3. The EOPNOTSUPP error path (sendfile may fail on some filesystems) is not tested

Location

Suggested Fix

Add a test that:

  1. Creates a temporary file with known content
  2. Creates a File object representing it
  3. Calls over a pipe
  4. Receives the data and verifies it matches
  5. Also tests the error case with an invalid file descriptor

Note: works over pipes on Linux (copies data through), which can be used for testing without a TCP connection.

Severity

Low

Category

Quality

## Description The function in provides zero-copy file transfer using . However, there are no unit tests covering this code path: 1. No test for sending a file over a pipe 2. No test for the sendfile path in the client_send pipeline 3. The EOPNOTSUPP error path (sendfile may fail on some filesystems) is not tested ## Location ## Suggested Fix Add a test that: 1. Creates a temporary file with known content 2. Creates a File object representing it 3. Calls over a pipe 4. Receives the data and verifies it matches 5. Also tests the error case with an invalid file descriptor Note: works over pipes on Linux (copies data through), which can be used for testing without a TCP connection. ## Severity Low ## Category Quality
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#71