Skip to content

who: cover utmp record types from a fixture - #14154

Open
itay-raveh wants to merge 2 commits into
uutils:mainfrom
itay-raveh:tests-who-utmp-records
Open

who: cover utmp record types from a fixture#14154
itay-raveh wants to merge 2 commits into
uutils:mainfrom
itay-raveh:tests-who-utmp-records

Conversation

@itay-raveh

Copy link
Copy Markdown

Add a Linux/glibc utmp fixture builder and run who against run-level, boot-time, clock-change, init, login, user, dead-process. uptime now uses the same builder.

The test covers default output, --all --heading, --count, and --lookup.

Comment thread tests/common/utmp.rs
@@ -0,0 +1,92 @@
// This file is part of the uutils coreutils package.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why do we need a new file ? it can't be in who ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I wanted to use LinuxGlibcUtmpRecord and write_linux_glibc_utmp in both places, so I created a shared file. Do you prefer uptime import from who?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ok, makes sense, thanks

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/misc/tty-eof (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/retry (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/printf/printf-surprise is now being skipped but was previously passing.
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.

@codspeed-hq

codspeed-hq Bot commented Aug 26, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 9.99%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 6 improved benchmarks
✅ 351 untouched benchmarks
⏩ 50 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation true_consecutive_calls 350.2 ns 294.7 ns +18.85%
Simulation split_lines 10.6 ms 9.2 ms +15.15%
Simulation split_numeric_suffix 11.1 ms 9.7 ms +14.36%
Simulation split_bytes 675.4 µs 644.4 µs +4.82%
Simulation uniq_case_insensitive[10000] 3 ms 2.8 ms +4.35%
Simulation uniq_with_count[10000] 3.8 ms 3.7 ms +3.43%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing itay-raveh:tests-who-utmp-records (5fe83de) with main (a817fa0)2

Open in CodSpeed

Footnotes

  1. 50 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.

  2. No successful run was found on main (728388e) during the generation of this report, so a817fa0 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@sylvestre
sylvestre force-pushed the tests-who-utmp-records branch from 5fe83de to ddfd6e4 Compare August 26, 2026 16:26
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.

who/unix.rs: improve code coverage

2 participants