Skip to content

[DeepTest] Add Comprehensive test suite for DataPath Winuser#5873

Draft
saikat107 wants to merge 13 commits intomainfrom
DeepTest/datapath_test
Draft

[DeepTest] Add Comprehensive test suite for DataPath Winuser#5873
saikat107 wants to merge 13 commits intomainfrom
DeepTest/datapath_test

Conversation

@saikat107
Copy link
Contributor

This pull request adds a comprehensive suite of DataPath WinUser test declarations and ensures the new test source file is included in the build process. The main focus is on expanding test coverage for DataPath functionality by introducing a large number of new test function prototypes and registering the new test file with CMake.

DataPath WinUser Test Additions:

  • Added declarations for a wide range of DataPath-related test functions (e.g., UDP/TCP initialization, address resolution, socket operations, feature queries, and segmented send/receive scenarios) to MsQuicTests.h. These cover various edge cases and configurations for DataPath functionality.

Build System Update:

  • Registered the new DatapathWinUserTest.cpp file in the src/test/lib/CMakeLists.txt to ensure these tests are compiled and included in the test suite.

saikat107 and others added 13 commits March 17, 2026 17:25
Add tests covering:
- ECN send paths (IPv4 and IPv6)
- DSCP send paths (IPv4 and IPv6)
- IPv6 UDP send/receive
- IPv6 server socket creation
- UDP socket SHARE flag
- MAX_THROUGHPUT send flag (enqueue path)
- IPv6 TCP connect
- TCP statistics query
- TCP send/receive with data verification
- UDP bind to specific port
- Multiple sequential UDP sends
- Feature query with different socket flags
- Non-zero ClientRecvContextLength initialization
- Segmented send data alloc and free
- CxPlatRecvDataReturn(NULL) safety
- Dual-stack server with IPv4 client
- TCP connect/disconnect lifecycle
- Large UDP payload send
- DSCP recv socket option path (EnableDscpOnRecv)

All 62 DataPath tests pass (40 existing + 22 new).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace repetitive initialization/teardown code with RAII scope helper
structs: DatapathScope, UdpSocketScope, SendDataScope, EventScope, and
TcpSocketScope. Add static DefaultUdpCallbacks and DefaultTcpCallbacks
constants to eliminate duplicated callback struct declarations.

Refactored 37 tests using DatapathScope (UDP-only, UDP+TCP, and custom
config variants), 26 uses of UdpSocketScope, 11 SendDataScope, 11
EventScope, and 7 TcpSocketScope instances. Tests using non-default
UDP callbacks (DatapathTestUdpRecvCallback) or custom TCP callbacks
retain manual init/uninit to preserve correct cleanup ordering.

All 74 test functions preserved with unchanged signatures, assertions,
and test logic. File reduced from 4130 to 3503 lines.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Increase TcpTestScope destructor sleep from 200ms to 500ms to allow
  async IO completion on slow CI machines
- Increase TcpSendRecv manual cleanup sleep from 200ms to 500ms
- Add null check in GetListenerPort() to prevent crash if listener
  creation fails (TEST_QUIC_SUCCEEDED returns from helper, not caller)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant