Skip to content

Conversation

@ChrisDryden
Copy link
Collaborator

@ChrisDryden ChrisDryden commented Nov 22, 2025

There's been an open issue for a while where a bunch of tests have been disabled in users and who because when going through the file lists of users it will return users that do not have an active PID. This issue is documented here and outlines that two things need to be fixed, first using the kill command to tell if a user is active and then adding an entry into the CICD yml so that the tests can run: #3219

This causing issues with the code coverage is documented here: #9060

The main functionality changes are that it now runs kill for the users with the 0 flag to be able to determine whether the user is active. To be able to run this without having to use unsafe I have included the nix library. Other than that the changes are to add the user fix in the yml thats decribed in the issue 3219 and re-enabled the tests.

A follow up would be to make the tests across the suite follow the new macro conventions. Theres a discrepancy in the one test that was disabled in 2022 that checks the version of GNU, the current tests ignore this and just flag a warning but this one was not updated to use the new macro.

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@ChrisDryden ChrisDryden marked this pull request as draft November 22, 2025 15:49
@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 22, 2025

CodSpeed Performance Report

Merging #9442 will not alter performance

Comparing ChrisDryden:who_check_pid (9713e98) with main (77c3498)

Summary

✅ 136 untouched
⏩ 6 skipped1

Footnotes

  1. 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

Copy link
Contributor

@jtracey jtracey left a comment

Choose a reason for hiding this comment

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

Looks good, all my comments are minor.

Kill is a pretty safe function (from a Rust safety guarantee perspective—it just takes two integers, no pointers or raw indexes), so if the nix dependency ends up causing problems in uucore, I'd say just use the unsafe libc calls. Otherwise, we already use nix in a bunch of utils, so if it works, it works.

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

Copy link
Contributor

@jtracey jtracey left a comment

Choose a reason for hiding this comment

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

LGTM!

@ChrisDryden
Copy link
Collaborator Author

@cakebaker @sylvestre is there anything I could do to make these PR's easier to review? theres a few in the backlog along with this one and the stty ones that was hoping to get reviewed. Are they too large?

@sylvestre
Copy link
Contributor

fixing the build issue would help :)


   Compiling coreutils v0.4.0 (/home/runner/work/coreutils/coreutils)
warning: ignoring -C extra-filename flag due to -o flag

error[E0433]: failed to resolve: use of undeclared type `Errno`
  --> src/uucore/src/lib/features/process.rs:75:41
   |
75 |     unsafe { libc::kill(pid, 0) == 0 || Errno::last() != Errno::ESRCH }
   |                                         ^^^^^ use of undeclared type `Errno`
   |
help: consider importing one of these enums
   |
10 + use crate::Errno;
   |
10 + use nix::errno::Errno;
   |

error[E0433]: failed to resolve: use of undeclared type `Errno`
  --> src/uucore/src/lib/features/process.rs:75:58
   |
75 |     unsafe { libc::kill(pid, 0) == 0 || Errno::last() != Errno::ESRCH }
   |                                                          ^^^^^ use of undeclared type `Errno`
   |
help: consider importing one of these enums
   |
10 + use crate::Errno;
   |
10 + use nix::errno::Errno;
   |

For more information about this error, try `rustc --explain E0433`.
warning: `uucore` (lib) generated 1 warning
error: could not compile `uucore` (lib) due to 2 previous errors; 1 warning emitted

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@ChrisDryden
Copy link
Collaborator Author

My bad that was from the rebase just now and I just added the fix

@github-actions
Copy link

github-actions bot commented Dec 7, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

github-actions bot commented Dec 7, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

Copy link
Contributor

@sylvestre sylvestre left a comment

Choose a reason for hiding this comment

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

see comments

@github-actions
Copy link

GNU testsuite comparison:

Note: The gnu test tests/pr/pr-tests was skipped on 'main' but is now failing.

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.

3 participants