Skip to content

tests: drop unused pipe_in calls and keep date checks valid across UTC midnight - #15413

Open
ChihweiLHBird wants to merge 2 commits into
uutils:mainfrom
ChihweiLHBird:zhiwei/fix-date-utc-midnight-and-unused-pipe-in
Open

ChihweiLHBird wants to merge 2 commits into
uutils:mainfrom
ChihweiLHBird:zhiwei/fix-date-utc-midnight-and-unused-pipe-in

Conversation

@ChihweiLHBird

@ChihweiLHBird ChihweiLHBird commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

test_relative_weekdays, test_date_numeric_d_basic_utc and test_date_military_timezone_with_offset_and_date read today's UTC date once and then run date several times against it. If UTC midnight passes in between, date is already on the next day and the test fails although nothing is wrong.

This PR reads the date before and after each date run. If the day changed, test_relative_weekdays runs that case again, since its input is computed from today, and the other two accept the result for either day. Otherwise the checks are as strict as before.

The second commit follows up on #14431: the four numfmt and sort tests it changed fail while parsing arguments and never read stdin, so pipe_in("") does nothing there, and without it the harness gives them /dev/null.

Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 05:43

Copilot AI left a comment

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.

🟢 Approval recommended

The changes are limited to test cleanup and midnight handling, with no blocking issues identified.

0 open findings

What changed in this PR

This test-only PR reduces UTC-midnight flakiness and removes unnecessary stdin setup.

Changes:

  • Handle UTC date transitions in weekday, numeric-date, and military-timezone tests.
  • Remove empty pipe_in calls from argument-validation tests.
File Description
tests/​by-util/​test_sort.rs Remove unnecessary empty stdin setup.
tests/​by-util/​test_numfmt.rs Remove unnecessary empty stdin setup.
tests/​by-util/​test_date.rs Make date assertions tolerate UTC-midnight transitions.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

No deployments
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.

2 participants