runtime: Some DateTimeTest format tests fail on the upcoming Fedora 39

System.Tests.DateTimeTests.TryFormat_MatchesToString(format: \"f\")
System.Tests.DateTimeTests.TryFormat_MatchesToString(format: \"F\")
System.Tests.DateTimeTests.TryFormat_MatchesToString(format: \"g\")
System.Tests.DateTimeTests.TryFormat_MatchesToString(format: \"G\")
System.Tests.DateTimeTests.TryFormat_MatchesToString(format: \"t\")
System.Tests.DateTimeTests.TryFormat_MatchesToString(format: \"T\")
System.Tests.DateTimeTests.TryFormat_MatchesToString(format: \"U\")
System.Tests.DateTimeTests.ParseExact_ToStringThenParseExactRoundtrip_Success(standardFormat: \"f\")
System.Tests.DateTimeTests.ParseExact_ToStringThenParseExactRoundtrip_Success(standardFormat: \"F\")
System.Tests.DateTimeTests.ParseExact_ToStringThenParseExactRoundtrip_Success(standardFormat: \"g\")
System.Tests.DateTimeTests.ParseExact_ToStringThenParseExactRoundtrip_Success(standardFormat: \"G\")
System.Tests.DateTimeTests.ParseExact_ToStringThenParseExactRoundtrip_Success(standardFormat: \"t\")
System.Tests.DateTimeTests.ParseExact_ToStringThenParseExactRoundtrip_Success(standardFormat: \"T\")
System.Tests.DateTimeTests.ParseExact_ToStringThenParseExactRoundtrip_Success(standardFormat: \"U\")
System.Tests.DateTimeOffsetTests.TryFormat_ToString_EqualResults
System.Tests.DateTimeOffsetTests.ParseExact_ToStringThenParseExactRoundtrip_Success(standardFormat: \"f\")
System.Tests.DateTimeOffsetTests.ParseExact_ToStringThenParseExactRoundtrip_Success(standardFormat: \"F\")
System.Tests.DateTimeOffsetTests.ParseExact_ToStringThenParseExactRoundtrip_Success(standardFormat: \"g\")
System.Tests.DateTimeOffsetTests.ParseExact_ToStringThenParseExactRoundtrip_Success(standardFormat: \"G\")
System.Tests.DateTimeOffsetTests.ParseExact_ToStringThenParseExactRoundtrip_Success(standardFormat: \"t\")
System.Tests.DateTimeOffsetTests.ParseExact_ToStringThenParseExactRoundtrip_Success(standardFormat: \"T\")

It’s likely there was a regression in https://github.com/dotnet/runtime/pull/83589 which was not caught in CI.

The test failures are from our CI machine. I will reproduce the issue locally and share more information.

cc @tarekgh @omajid

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16 (16 by maintainers)

Most upvoted comments

@tarekgh the parser issues occur when a non-breaking space occurs in the format string.

The tests fail for AllowWhiteSpaces because the parser expects skipped whitespace to match with regular spaces only. We can allow it to match it also with the non-breaking spaces.

What is probably not covered by any tests: what should happen (without AllowWhiteSpaces) when the format string has a non-breaking space, and the string being parsed has a regular, or a different type of non-breaking space at that position?

(edit:) or is this fully covered by:

https://github.com/dotnet/runtime/blob/33b18692fdf2ef438de3da38bc419c6616a746c5/src/libraries/System.Runtime/tests/System/DateTimeTests.cs#L2021-L2023

right, don’t keep C locale as default. We use Invariant culture at that time which will not have U+202F in the time formats.