generated from finos/software-project-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 242
Open
Description
Bug Report
Steps to Reproduce:
- Clone the
legend-enginerepository. - Navigate to the
legend-engine-executionPlan-executionmodule. - Execute the Maven test suite using the command:
mvn clean test -Dtest=TestPureDate. - Observe the test failure in the
testFormatWithTimeZoneShiftmethod.
Expected Result:
The test should pass
BUILD SUCCESS without any assertion errors, confirming that the date-time string is formatted correctly with the expected timezone abbreviation (e.g., CST).
Actual Result:
The test fails because the date-time string is formatted using a GMT offset instead of the short ID:
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] TestPureDate.testFormatWithTimeZoneShift:71 expected:<...-12-31 19:01:01.070 [CST]> but was:<...-12-31 19:01:01.070 [GMT-06:00]>
[INFO]
[ERROR] Tests run: 15, Failures: 1, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] -----------------------------------------------------------------------
-
Environment:
- Project version/build:
4.122.1-SNAPSHOT - OS and runtime versions:
Windows 11,OpenJDK Temurin 11.0.30,Maven 3.9.11 - Virtualised environment: None
Proposed Solution:
The failure is caused by the JDK's switch to the CLDR (Unicode Common Locale Data Repository) as the default locale provider, which sometimes formats the z pattern as a GMT offset instead of a short ID.
I propose updating the assertion in testFormatWithTimeZoneShift to accept both the short ID (e.g., CST) and the GMT offset (e.g., GMT-06:00). This ensures the test remains environment-agnostic while still validating the correct time-shift logic.
I intend to submit a Pull Request for this immediately.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels