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

Fix testLuceneDatasets(TestRS): outcome depends on local time zone. #206

Merged
merged 2 commits into from Nov 2, 2018

Conversation

Projects
None yet
2 participants
@RKrahl
Copy link
Member

RKrahl commented Aug 16, 2018

The outcome of the test testLuceneDatasets in src/test/java/org/icatproject/integration/TestRS.java depends on the local time zone setting. It will succeed if the local time zone is British time (Europe/London) and fail otherwise.

The cause is the following: as more or less all the tests, this test depends on the data imported from src/test/resources/icat.port. In this import file, the third dataset ds3 (having gamma in the description) is set with a startDate and endDate without a time zone indication. As a result, these date values will be taken as local time on import. But the test searches for this dataset within a date intervall from 2014-05-16T05:09:03+0000 to 2014-05-16T05:15:26+0000. If the local time zone during import is different from +01:00 (e.g. BST), the dataset will not match the search condition and the test will fail.

As a fix, this PR adds a time zone indication for this dataset in the test data, making it independent from the local time zone during import.

@stuartpullinger stuartpullinger merged commit 564b89a into master Nov 2, 2018

@RKrahl RKrahl deleted the testLuceneDatasets branch Nov 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment