Skip to content

Fix Intermittent tests/date/date-locale-hour.sh#11497

Open
sylvestre wants to merge 5 commits intouutils:mainfrom
sylvestre:intermitten-date-locale-hour
Open

Fix Intermittent tests/date/date-locale-hour.sh#11497
sylvestre wants to merge 5 commits intouutils:mainfrom
sylvestre:intermitten-date-locale-hour

Conversation

@sylvestre
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tty/tty-eof (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/tail/tail-n0f is now passing!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 25, 2026

Merging this PR will not alter performance

✅ 309 untouched benchmarks
⏩ 46 skipped benchmarks1


Comparing sylvestre:intermitten-date-locale-hour (e23df9b) with main (bfdf580)

Open in CodSpeed

Footnotes

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

@sylvestre sylvestre marked this pull request as ready for review March 26, 2026 07:56
Comment thread src/uu/date/src/date.rs Outdated
@sylvestre sylvestre force-pushed the intermitten-date-locale-hour branch 2 times, most recently from c4d86ed to e66702c Compare April 5, 2026 20:34
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/date/resolution (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/tail/pipe-f is now being skipped but was previously passing.
Congrats! The gnu test tests/seq/seq-epipe is now passing!

@sylvestre sylvestre requested a review from cakebaker April 6, 2026 09:33
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

GNU testsuite comparison:

Note: The gnu test tests/tail/pipe-f is now being skipped but was previously passing.
Congrats! The gnu test tests/pr/bounded-memory is now passing!
Congrats! The gnu test tests/seq/seq-epipe is now passing!

@sylvestre sylvestre force-pushed the intermitten-date-locale-hour branch from 84bbc0d to 857d820 Compare April 6, 2026 13:23
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/cut/cut-huge-range is now being skipped but was previously passing.

Comment thread tests/by-util/test_date.rs Outdated
Comment on lines +2367 to +2369
let stdout_bytes = result.stdout();
assert_eq!(stdout_bytes[0], 0xFF);
assert_eq!(&stdout_bytes[1..3], b"10");
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.

You can simplify it by using stdout_is_bytes:

        .succeeds()
        .stdout_is_bytes(b"\xFF10\n");

Comment thread tests/by-util/test_date.rs Outdated
Comment on lines +2378 to +2380
let stdout_bytes = result.stdout();
// \xC4\xEA + "10" + \xD4\xC2 + "11" + \xC8\xD5 + "\n"
assert_eq!(stdout_bytes, b"\xc4\xea10\xd4\xc211\xc8\xd5\n");
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.

The same here.

@sylvestre sylvestre force-pushed the intermitten-date-locale-hour branch from 857d820 to a25d90b Compare April 6, 2026 14:33
Comment thread src/uu/date/src/date.rs Outdated
utc: bool,
format: Format,
/// Raw format bytes for Custom format, to preserve non-UTF-8 bytes in output
format_raw: Option<Vec<u8>>,
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 you introduce an additional property instead of adapting the Format enum?

Comment thread src/uu/date/src/date.rs
return Err(USimpleError::new(
1,
translate!("date-error-extra-operand", "operand" => format_args[1]),
translate!("date-error-extra-operand", "operand" => format_args[1].to_string_lossy()),
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.

GNU date doesn't use a lossy string in this case. But it is only an error message so it depends on how close we want to be to GNU date.

$ date -d "2025-12-16" +%m $'+\xFF%Y'
date: extra operand ‘+\377%Y’

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)

Comment thread src/uu/date/src/date.rs
let format = if let Some(form) = matches.get_one::<OsString>(OPT_FORMAT) {
let raw_bytes = form.as_encoded_bytes();
if raw_bytes.first() != Some(&b'+') {
let form_lossy = form.to_string_lossy();
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.

The same here.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

GNU testsuite comparison:

GNU test failed: tests/tail/pipe-f2. tests/tail/pipe-f2 is passing on 'main'. Maybe you have to rebase?
Note: The gnu test tests/basenc/bounded-memory is now being skipped but was previously passing.

Fixes intermittent: tests/date/date-locale-hour.sh

The GNU test date-locale-hour.sh picks 10 random locales via
`locale -a | shuf -n 10`. In CI, zh_CN.GB18030 is installed and its
date_fmt contains Chinese characters (年, 月, 日) encoded in GB18030,
which is not valid UTF-8.
@sylvestre sylvestre force-pushed the intermitten-date-locale-hour branch from 7ac2d9b to e23df9b Compare April 12, 2026 15:46
@github-actions
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/tail/tail-n0f (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/basenc/bounded-memory is now passing!

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