Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libsubprocess/test: Fix racy fd count in test #6553

Merged

Conversation

chu11
Copy link
Member

@chu11 chu11 commented Jan 14, 2025

Problem: A file descriptor counting test accesses /proc/PID/fd to count file descriptors. The ls used in the test may lead to an additional file descriptor that is not accounted for.

Increase the expected number of file descriptors in the test to account for the one used with ls.

Fixes #6551


side note: it's possible my guess is wrong. But per some debug output I saw

# stdout: lrwx------ 1 achu achu 64 Jan 13 12:16 0 -> socket:[80034010]
# stdout: lrwx------ 1 achu achu 64 Jan 13 12:16 1 -> socket:[80034012]
# stdout: lrwx------ 1 achu achu 64 Jan 13 12:16 2 -> socket:[80034014]
# stdout: lr-x------ 1 achu achu 64 Jan 13 12:16 3 -> /proc/1128034/fd

I do have evidence that it can appear.

Problem: A file descriptor counting test accesses /proc/PID/fd to
count file descriptors.  The `ls` used in the test may lead to an
additional file descriptor that is not accounted for.

Increase the expected number of file descriptors in the test to account
for the one used with `ls`.

Fixes flux-framework#6551
Copy link
Contributor

@grondo grondo left a comment

Choose a reason for hiding this comment

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

This seems reasonable. Thanks for running it down!

@mergify mergify bot merged commit 6326cbb into flux-framework:master Jan 14, 2025
35 checks passed
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.41%. Comparing base (2bbe885) to head (7018f49).
Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #6553       +/-   ##
===========================================
+ Coverage   41.41%   79.41%   +37.99%     
===========================================
  Files         478      531       +53     
  Lines       79788    88196     +8408     
===========================================
+ Hits        33048    70044    +36996     
+ Misses      46740    18152    -28588     

see 476 files with indirect coverage changes

@chu11 chu11 deleted the issue6551_libsubprocess_fd_cleanup branch January 14, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

libsubprocess: Error: not ok 253 - 5 file descriptors are open (expected 3-4)
2 participants