Skip to content
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

testBindInstantFromJavaUtilDate fails on systems in the Pacific/Auckland time zone [SPR-16534] #21077

Closed
spring-projects-issues opened this issue Feb 26, 2018 · 1 comment
Assignees
Labels
status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

William Hoyle opened SPR-16534 and commented

The DateTimeFormattingTests.testBindInstantFromJavaUtilDate test fails if run on a machine with a default time zone of "Pacific/Auckland" (UTC+12/13 depending on the time of year).

To reproduce:

Force the time zone in spring-context/spring-context.gradle:

test {
    systemProperty 'user.timezone', 'Pacific/Auckland'
}

Run the test:

./gradlew :spring-context:test --tests org.springframework.format.datetime.standard.DateTimeFormattingTests

Results in:

> Task :spring-context:test FAILED

org.springframework.format.datetime.standard.DateTimeFormattingTests > testBindInstantFromJavaUtilDate FAILED
    java.lang.AssertionError at DateTimeFormattingTests.java:366

Affects: 4.3.14, 5.0.4

Referenced from: commits 7d89de0, 8181c02

Backported to: 4.3.15

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Good catch! We're enforcing the execution of that test within the GMT time zone now, manipulating TimeZone.getDefault() accordingly (since that's what that old Date constructor is relying on).

@spring-projects-issues spring-projects-issues added type: bug A general bug status: backported An issue that has been backported to maintenance branches labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.0.5 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants