Skip to content

Set the socket UT receive timeout to 50 ms - #6216

Merged
thomas-bc merged 1 commit into
nasa:develfrom
tivris:socket-ut-recv-timeout
Oct 16, 2026
Merged

thomas-bc merged 1 commit into
nasa:develfrom
tivris:socket-ut-recv-timeout

Conversation

@tivris

@tivris tivris commented Oct 16, 2026

Copy link
Copy Markdown
Contributor
Related Issue(s) Fixes #6211
Has Unit Tests (y/n) y
Documentation Included (y/n) n
Generative AI was used in this contribution (y/n) y

Change Description

Increases the receive timeout that force_recv_timeout in Drv/Ip/test/ut/SocketTestHelper.cpp sets from 50 us to 50 ms. The comment added with it in 8b4e870082 said 50 ms; #5705 reworded the comment to 50 us without changing the value.

Rationale

With #5706's 10 ms polling waits, 50 us receive timeouts overflow the reconnect-test histories on macOS (#6211). Doubling those histories in #5724 was not enough; at 50 ms the measured runs record 20 to 36 entries of the 2000.

Testing/Review Recommendations

macOS (Apple M5):

  • Drv_TcpServer_ut_exe, Drv_Udp_ut_exe, Drv_TcpClient_ut_exe, Drv_Ip_Tcp_test, Drv_Ip_Udp_test: 20 of 20 runs pass for each, at normal priority and under taskpolicy -c background. Unmodified devel: TcpServer and Udp abort in 20 of 20 under background.
  • fprime-util check --all: 135 of 135 pass.
  • clang-format --dry-run -Werror and git diff --check pass.

Linux (arm64 VM): Drv_Udp_ut_exe takes about 0.5 s longer; the other four are unchanged.

Expected, not measured with gcov: Drv/TcpServer line coverage may drop from 64/74 to 63/74, because TcpServerComponentImpl.cpp:62 (RECV_NO_DATA) was only reached through the incidental 50 us timeouts.

Future Work

A deterministic RECV_NO_DATA test for TcpServer would cover that line again.

Contributor Checklist

AI Usage (see policy)

The change is AI-generated.

@thomas-bc thomas-bc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small and efficient, much appreciated. Thanks.

@github-actions

This comment was marked as resolved.

@thomas-bc

Copy link
Copy Markdown
Collaborator

I'm going to merge #6217 first and see if (1) the error shows up in devel CI and (2) this PR fixes it

@lestarch-autobot
lestarch-autobot self-requested a review October 16, 2026 19:55
@thomas-bc
thomas-bc merged commit 82d5b71 into nasa:devel Oct 16, 2026
77 checks passed
@thomas-bc

Copy link
Copy Markdown
Collaborator

That fixed it ! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drv/TcpServer and Drv/Udp UTs abort on macOS: 50 us forced receive timeout overflows tester history

3 participants