Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

NTP Tests bug, when time is changed #2376

Closed
petarnv opened this issue Oct 30, 2016 · 6 comments
Closed

NTP Tests bug, when time is changed #2376

petarnv opened this issue Oct 30, 2016 · 6 comments

Comments

@petarnv
Copy link
Contributor

petarnv commented Oct 30, 2016

In the NTP Binding Tests the "Europe/Helsinki" time zone is used. But recently there has been a time change in this time zone and that broke two of the tests:

  1. 'if no time zone is set in the configuration, the string channel is updated with the default one'

The message is:
The string channel was not updated with the right timezone
Expected: is "EEST"
but: was "EET"

Aparently the abbreviation EEST(Eastern European Summer Time) is used only in summer and now that the time is changed the abbreviation, that is returned is EET(Eastern European Time) - https://www.timeanddate.com/time/zones/eest

  1. 'if no time zone is set in the configuration, the dateTime channel is updated with the default one'

The message is:
The dateTime channel was not updated with the right timezone
Expected: is "+0300"
but: was "+0200"

Now that the time is changed, the current offset is +0200, not +0300

I have made a PR with a fix for this: #2377

@J-N-K
Copy link
Contributor

J-N-K commented Nov 3, 2016

There is an additional problem (at least on my system) which is probably related and NOT fixed. Build on my Win 10 machine fails because OEZ is returned instead of EET. OEZ is the correct name in germany, so there might be a localization issue involved.

@petarnv
Copy link
Contributor Author

petarnv commented Nov 4, 2016

@J-N-K, thank you for finding this problem. It is indeed localization issue. I have made a PR with a fix: #2407. Can you run it on your machine, please?

@J-N-K
Copy link
Contributor

J-N-K commented Nov 4, 2016

Works for me. Thanks.

@maggu2810
Copy link
Contributor

Also with a merged #2407 I run into this error:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest
Tests run: 16, Failures: 1, Errors: 0, Skipped: 2, Time elapsed: 21.705 sec <<< FAILURE! - in org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest
the dateTime channel is updated with the right time zone(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest) skipped
time is refreshed when string channel is linked(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest)  Time elapsed: 0.22 sec
if no time zone is set in the configuration, the dateTime channel is updated with the default one(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest)  Time elapsed: 0.138 sec
time is refreshed when dateTime channel is linked(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest)  Time elapsed: 0.097 sec
the status of a thing with string channel is updated with communication error, when unknown host is set in the configuraion(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest)  Time elapsed: 10.032 sec
the string channel is updated with the right formatting(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest)  Time elapsed: 0.118 sec
if the property for formatting in the configuration of the string channel is null, the default formatting is used(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest)  Time elapsed: 0.116 sec
if no property for formatting is set in the configuration of the string channel, the default formatting is used(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest)  Time elapsed: 0.115 sec
if the property for formatting in the configuration of the string channel is empty string, the default formatting is used(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest)  Time elapsed: 0.118 sec
the calendar of the dateTime channel is updated with the right time zone(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest) skipped
the string channel is updated with the right time zone(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest)  Time elapsed: 0.121 sec  <<< FAILURE!
java.lang.AssertionError: The string channel was not updated with the right timezone
Expected: is "PDT"
     but: was "PST"
    at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
    at org.junit.Assert.assertThat(Assert.java:865)
    at org.junit.Assert$assertThat$0.callStatic(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:53)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:157)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:173)
    at org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest.the string channel is updated with the right time zone(NtpOSGiTest.groovy:172)

if no time zone is set in the configuration, the string channel is updated with the default one(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest)  Time elapsed: 0.115 sec
the string channel is updated on handleCommand(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest)  Time elapsed: 0.045 sec
the dateTime channel is updated on handleCommand(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest)  Time elapsed: 0.043 sec
if no time zone is set in the configuration, the calendar of the dateTime channel is updated with the default one(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest)  Time elapsed: 0.116 sec
the status of a thing with dateTime channel is updated with communication error, when unknown host is set in the configuraion(org.eclipse.smarthome.binding.ntp.test.NtpOSGiTest)  Time elapsed: 10.019 sec

Results :

Failed tests: 
  NtpOSGiTest.the string channel is updated with the right time zone:172 The string channel was not updated with the right timezone
Expected: is "PDT"
     but: was "PST"

Tests run: 16, Failures: 1, Errors: 0, Skipped: 2

@J-N-K
Copy link
Contributor

J-N-K commented Nov 6, 2016

That's the same problem like EET vs. EST, they changed back from PDT to PST this weekend in the US

@petarnv
Copy link
Contributor Author

petarnv commented Nov 6, 2016

Yes, it was the same problem, but this time, caused by time change in the US. I have made a PR with fix: #2414

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants