-
Notifications
You must be signed in to change notification settings - Fork 682
Ensure that tests are always executed in a proper time zone #2551
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
Ensure that tests are always executed in a proper time zone #2551
Conversation
Just curious - it looks like several of the jerryscript date tests ( |
@crazy2be What's your setup? I just tried And BTW, did the test262 tests pass for you with this patch? |
Hmm, interesting. All tests appear to pass for me as well on The relevant thought I had with regards to this PR is that we should make the test-runner set the correct timezone for the jerry-tests, since we are now doing it for the test262 tests (as of this PR!). Then people in other timezones (like me!) can just run the tests without expecting failures, or having to remember the correct timezone for each suite of tests. |
I think it should be possible to lock the TZ for the other tests as well. I'll update this patch later tonight. I'll try to set TZ to Europe/Budapest. One is allowed to be just a bit patriotic, right? :) |
Ok, I figured out the
However, now that we have proper timezone/dst support, any other timezone causes failures. This makes sense, since the part that is failing is
This shouldn't be expected to work in any timezone other than the one used to retrieve the UTC ms value, which clearly was UTC, given
Thus, we can (and should!) make sure these tests are always run in a particular timezone. However, if that timezone is anything other than |
I realize I never answered your second question. Yes, this patch does in fact make it so that the test262 tests pass on my system, without having to change my timezone manually.
With just the command line
Awesome! |
Thanks for the analysis (UTC it will be then) and thanks for the feedback. |
The America/Los_Angeles time zone is already enforced for test262 Travis CI jobs but that doesn't guarantee the correctness of locally executed tests. So, this patch moves the setting of the `TZ` environment variable from `.travis.yml` to `run-tests.py`. The date-related tests in the jerry test suite also rely on a time zone (UTC). Thus, `TZ` is forced for those tests, too. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
3f80a17
to
66a5bff
Compare
PR updated. Proper time zone is enforced for both test262 and jerry tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The America/Los_Angeles time zone is already enforced for Travis CI
jobs but that doesn't guarantee the correctness of locally executed
tests. So, this patch moves the setting of the
TZ
environmentvariable from
.travis.yml
torun-tests.py
.JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu