-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jackson integration tests fail if TZ is west of GMT #37662
Comments
Rather than testing an exact time stamp string, the test checks that the date starts with |
It looks like this problem is much worse than expected. Within Jackson we have this ominous note (see // Alas, can't just call `_serializeAsString()`....
if (_customFormat == null) {
// 11-Oct-2016, tatu: For backwards-compatibility purposes, we shall just use
// the awful standard JDK serialization via `sqlDate.toString()`... this
// is problematic in multiple ways (including using arbitrary timezone...)
g.writeString(value.toString());
return;
}
_serializeAsString(value, g, provider); So, it is known that this result will reflect Jackson's basically incorrect behavior. This gives us a few possible options: Option 1: Test the incorrect behavior to make sure it stays exactly as incorrect as it is now, but having the test pass in all time zones (i.e. "fix the test", and do regression testing only). Option 2: Drop the test, and say Option 2a: Just drop the test. Users are on their own. Option 3: Provide a "correct" serializer which converts the |
In this case the problem appears doubled. The date is wrongly serialized in the request, which subtracts a day, and then wrongly serialized on the response as well, which subtracts another day. |
Fixes quarkusio#37662. Emulate the problematic transformation perpetrated by Jackson to ensure the result is "expected". Tested in multiple timezones in multiple continents, including unusual time zones and time zones near the date line.
Describe the bug
Test fails if time zone is west of GMT:
Expected behavior
Test should pass in all local time zones.
Actual behavior
The test only passes in certain time zones with a positive offset.
How to Reproduce?
Run
TZ=America/Chicago mvn install -rf :quarkus-integration-test-jackson
after a clean build e.g.mvn clean && mvn install -DskipTests
.Output of
uname -a
orver
Darwin xxxxx 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:28:45 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6020 arm64
Output of
java -version
openjdk version "17.0.9" 2023-10-17 OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9) OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode)
Quarkus version or git rev
0d90b7c
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546) Maven home: /Users/david/local/apache-maven Java version: 17.0.9, vendor: Eclipse Adoptium, runtime: /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "14.1.2", arch: "aarch64", family: "mac"
Additional information
No response
The text was updated successfully, but these errors were encountered: