JackieTien97 commented on PR #820:
URL: https://github.com/apache/tsfile/pull/820#issuecomment-4478239343

   ### Code review
   
   Found 2 issues:
   
   1. Two existing tests assert exact English exception message text for 
messages that this PR migrates to i18n, so they break under a non-English JVM 
locale.
   
   `TsFileReaderTest.java` (not in this PR) asserts the literal string from the 
source that is now routed through 
`Messages.format("error.read.device_not_in_metadata", ...)` and 
`Messages.format("error.read.timeseries_not_aligned", ...)`:
   
   
https://github.com/apache/tsfile/blob/03c3aa6ad5436183c13a0174deeafebad0d89715/java/tsfile/src/test/java/org/apache/tsfile/read/TsFileReaderTest.java#L525-L540
   
   Under `-Dtsfile.locale=zh` (or a Chinese-default JVM), `e.getMessage()` 
returns the Chinese string from `messages_zh.properties` (`设备 {d3} 不在 
tsFileMetaData 中`), but the assertions expect the English form, so they fail.
   
   2. `TSEncodingBuilderTest.java` (added in #591, not in this PR) has the same 
problem for the encoding builder's unsupported-encoding message, which is also 
migrated by this PR via 
`Messages.format("error.encoding.ts_encoding_builder_unsupported", type)`:
   
   
https://github.com/apache/tsfile/blob/39e55a358291ca756f3ee5d8f85c144f3139ccec/java/tsfile/src/test/java/org/apache/tsfile/encoding/encoder/TSEncodingBuilderTest.java#L53-L61
   
   Both tests need a `System.setProperty("tsfile.locale", "en")` guard (like 
`MessagesTest` already does) or the assertion should be rewritten to avoid 
depending on the locale-sensitive text.
   
   🤖 Generated with [Claude Code](https://claude.ai/code)
   
   <sub>- If this code review was useful, please react with 👍. Otherwise, react 
with 👎.</sub>


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to