Repository navigation
tests: drop unused pipe_in calls and keep date checks valid across UTC midnight - #15413
Open
ChihweiLHBird wants to merge 2 commits into
Open
ChihweiLHBird wants to merge 2 commits into
ChihweiLHBird wants to merge 2 commits into
Conversation
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
Contributor
There was a problem hiding this comment.
🟢 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_incalls 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test_relative_weekdays,test_date_numeric_d_basic_utcandtest_date_military_timezone_with_offset_and_dateread today's UTC date once and then rundateseveral times against it. If UTC midnight passes in between,dateis already on the next day and the test fails although nothing is wrong.This PR reads the date before and after each
daterun. If the day changed,test_relative_weekdaysruns 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
numfmtandsorttests it changed fail while parsing arguments and never read stdin, sopipe_in("")does nothing there, and without it the harness gives them/dev/null.