coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

``uptime``: Support files in uptime

Open AnirbanHalder654322 opened this issue 1 year ago • 1 comments

Fixes #6393

Edit1 : I strace-d the whole thing , we seem to use more than 2x amount of read sys calls (will result in more than 100 extra read calls for very large iterations)compared to GNU uptime, which i believe is due to iter_all_records_from function in uucore::src::lib::features::utmpx

AnirbanHalder654322 avatar May 14 '24 12:05 AnirbanHalder654322

GNU testsuite comparison:

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

github-actions[bot] avatar May 14 '24 13:05 github-actions[bot]

GNU testsuite comparison:

GNU test failed: tests/timeout/timeout. tests/timeout/timeout is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar May 19 '24 18:05 github-actions[bot]

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
GNU test failed: tests/timeout/timeout. tests/timeout/timeout is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar May 26 '24 18:05 github-actions[bot]

Changes summary since last review.

  1. Testing using file with dynamically created binary utmp records. Not testing for macos , since i don't have access to make to figure out creation of the binaries. Added a todo for anyone who owns a mac.
  2. Added utmpxname() detection since it returns an error in mac systems when the filename doesn't end up 'x'.
  3. Some lint stuff.

AnirbanHalder654322 avatar May 27 '24 13:05 AnirbanHalder654322

Changes since last push:

The test test_uptime::test_uptime_for_file_without_utmpx_records has been disabled for freebsd , our uucore::utmpx module uses utmpxname() sys call to set the file from which we iterate through, freebsd uses different sets of syscall which function somewhat similarly yet have differences. Comments have been added to the tests which may pass the CI but they don't function as intended.

AnirbanHalder654322 avatar May 28 '24 10:05 AnirbanHalder654322

GNU testsuite comparison:

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

github-actions[bot] avatar May 28 '24 11:05 github-actions[bot]

The failing CI tests are unrelated to my PR.

AnirbanHalder654322 avatar May 28 '24 13:05 AnirbanHalder654322

GNU testsuite comparison:

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

github-actions[bot] avatar Jun 01 '24 20:06 github-actions[bot]

GNU testsuite comparison:

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

github-actions[bot] avatar Jun 02 '24 13:06 github-actions[bot]

GNU testsuite comparison:

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

github-actions[bot] avatar Jun 04 '24 22:06 github-actions[bot]

@sylvestre does this require any more changes ?

AnirbanHalder654322 avatar Jun 11 '24 16:06 AnirbanHalder654322

GNU testsuite comparison:

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

github-actions[bot] avatar Jun 19 '24 18:06 github-actions[bot]

GNU testsuite comparison:

Congrats! The gnu test tests/timeout/timeout is no longer failing!

github-actions[bot] avatar Jun 21 '24 18:06 github-actions[bot]

Changes since last push:

  • Removed quick_error in favor of thiserror
  • Added some documentation on the added dependencies. The clippy error seems to be unrelated to my pr

AnirbanHalder654322 avatar Jun 21 '24 18:06 AnirbanHalder654322

thanks!

sylvestre avatar Jun 22 '24 11:06 sylvestre