paulirwin opened a new pull request, #1078:
URL: https://github.com/apache/lucenenet/pull/1078

   - [X] You've read the [Contributor 
Guide](https://github.com/apache/lucenenet/blob/main/CONTRIBUTING.md) and [Code 
of Conduct](https://www.apache.org/foundation/policies/conduct.html).
   - [X] You've included unit or integration tests for your change, where 
applicable.
   - [X] You've included inline docs for your change, where applicable.
   - [X] There's an open issue for the PR that you are making. If you'd like to 
propose a change, please [open an 
issue](https://github.com/apache/lucenenet/issues/new/choose) to discuss the 
change or find an existing issue.
   
   Fixes tests that fail randomly when the randomly selected culture is 
zh-Hant-TW and the time zone offset is negative.
   
   Fixes #846
   
   ## Description
   
   See this comment for full details explaining the problem: 
https://github.com/apache/lucenenet/issues/846#issuecomment-2566110261
   
   The solution was to ensure that the zh-Hant-TW culture (on .NET 6-8 when it 
is missing the `tt` in the LongTimePattern) does not pass the "sanity" check 
when there is a time zone with a negative offset due to this round-trip 
formatting/parsing bug. There already was a sanity check for the unix epoch 
(long value 0) which ensured the round-trip to/from string was parsed 
_successfully_, but it was not checking that it was parsed _correctly_. This 
code had been modified heavily from the original Lucene and was missing this 
equality check.
   
   While investigating this, there were opportunities to clean up the code in 
this class, as well as to make it support using the `[Repeat]` attribute to 
help in diagnosing issues. The use of `String` was normalized to the `string` 
keyword, some redundant parentheses were removed, and the method capitalization 
was fixed. To enable `[Repeat]` support, several fields were moved from static 
to instance fields, and `OneTimeSetUp`/`OneTimeTearDown` was replaced with 
`SetUp`/`TearDown`. This allows for generating new random values when you 
repeat the test. Additionally, some extra info was added to the test assertion 
message to aid diagnosing issues if it fails.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to