You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2012/10/29 12:07:14 UTC
[jira] [Created] (DERBY-5964) Timestamp comparison failure in
AutomaticIndexStatisticsTest.testStatisticsCorrectness
Knut Anders Hatlen created DERBY-5964:
-----------------------------------------
Summary: Timestamp comparison failure in AutomaticIndexStatisticsTest.testStatisticsCorrectness
Key: DERBY-5964
URL: https://issues.apache.org/jira/browse/DERBY-5964
Project: Derby
Issue Type: Bug
Components: Test
Affects Versions: 10.10.0.0
Reporter: Knut Anders Hatlen
Priority: Minor
http://dbtg.foundry.sun.com/derby/test/Daily/jvm1.5/testing/testlog/lin/1402814-suitesAll_diff.txt
1) testStatisticsCorrectness(org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStatisticsTest)junit.framework.AssertionFailedError
at org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStatisticsTest.testStatisticsCorrectness(AutomaticIndexStatisticsTest.java:324)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:117)
at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:424)
at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:441)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
at junit.extensions.TestSetup.run(TestSetup.java:25)
at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
at junit.extensions.TestSetup.run(TestSetup.java:25)
The failure is caused by this assert:
assertTrue(s.created.before(now));
It might be a coincidence, but it happened the same night as Europe was switching from DST.
It may also be related to DERBY-5046, where a similar assert failed because poor clock resolution made the two timestamps equal.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (DERBY-5964) Timestamp comparison failure in
AutomaticIndexStatisticsTest.testStatisticsCorrectness
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5964?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Knut Anders Hatlen updated DERBY-5964:
--------------------------------------
Attachment: d5964-1a-run-in-gmt.diff
One way to make the test handle the ambiguity around the DST switch, is to force it to run in the GMT timezone, which doesn't observe DST. See the attached patch.
I changed the local time on my computer to one hour before the switch from DST and ran the store test suite with and without the patch. It failed without the patch, and passed when the patch was applied.
> Timestamp comparison failure in AutomaticIndexStatisticsTest.testStatisticsCorrectness
> --------------------------------------------------------------------------------------
>
> Key: DERBY-5964
> URL: https://issues.apache.org/jira/browse/DERBY-5964
> Project: Derby
> Issue Type: Bug
> Components: Test
> Affects Versions: 10.10.0.0
> Reporter: Knut Anders Hatlen
> Priority: Minor
> Attachments: d5964-1a-run-in-gmt.diff
>
>
> http://dbtg.foundry.sun.com/derby/test/Daily/jvm1.5/testing/testlog/lin/1402814-suitesAll_diff.txt
> 1) testStatisticsCorrectness(org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStatisticsTest)junit.framework.AssertionFailedError
> at org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStatisticsTest.testStatisticsCorrectness(AutomaticIndexStatisticsTest.java:324)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:117)
> at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:424)
> at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:441)
> at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> at junit.extensions.TestSetup.run(TestSetup.java:25)
> at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> at junit.extensions.TestSetup.run(TestSetup.java:25)
> The failure is caused by this assert:
> assertTrue(s.created.before(now));
> It might be a coincidence, but it happened the same night as Europe was switching from DST.
> It may also be related to DERBY-5046, where a similar assert failed because poor clock resolution made the two timestamps equal.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DERBY-5964) Timestamp comparison failure in
AutomaticIndexStatisticsTest.testStatisticsCorrectness
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485984#comment-13485984 ]
Knut Anders Hatlen commented on DERBY-5964:
-------------------------------------------
Make that four failures, same night:
http://dbtg.foundry.sun.com/derby/test/Daily/jvm1.5/testing/testlog/vista-64/1402814-suitesAll_diff.txt
http://dbtg.foundry.sun.com/derby/test/Daily/jvm1.5/testing/testlog/vista/1402814-suitesAll_diff.txt
> Timestamp comparison failure in AutomaticIndexStatisticsTest.testStatisticsCorrectness
> --------------------------------------------------------------------------------------
>
> Key: DERBY-5964
> URL: https://issues.apache.org/jira/browse/DERBY-5964
> Project: Derby
> Issue Type: Bug
> Components: Test
> Affects Versions: 10.10.0.0
> Reporter: Knut Anders Hatlen
> Priority: Minor
>
> http://dbtg.foundry.sun.com/derby/test/Daily/jvm1.5/testing/testlog/lin/1402814-suitesAll_diff.txt
> 1) testStatisticsCorrectness(org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStatisticsTest)junit.framework.AssertionFailedError
> at org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStatisticsTest.testStatisticsCorrectness(AutomaticIndexStatisticsTest.java:324)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:117)
> at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:424)
> at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:441)
> at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> at junit.extensions.TestSetup.run(TestSetup.java:25)
> at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> at junit.extensions.TestSetup.run(TestSetup.java:25)
> The failure is caused by this assert:
> assertTrue(s.created.before(now));
> It might be a coincidence, but it happened the same night as Europe was switching from DST.
> It may also be related to DERBY-5046, where a similar assert failed because poor clock resolution made the two timestamps equal.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DERBY-5964) Timestamp comparison failure in
AutomaticIndexStatisticsTest.testStatisticsCorrectness
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485962#comment-13485962 ]
Knut Anders Hatlen commented on DERBY-5964:
-------------------------------------------
Saw a very similar stacktrace on another machine the same night (running on a Raspberry Pi with Java SE 7 Embedded):
junit.framework.AssertionFailedError
at org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStatisticsTest.testStatisticsCorrectness(AutomaticIndexStatisticsTest.java:324)
at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:117)
at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:424)
at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:441)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
at junit.extensions.TestSetup.run(TestSetup.java:25)
at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
at junit.extensions.TestSetup.run(TestSetup.java:25)
Twice the same night *and* coinciding with the DST switch.
> Timestamp comparison failure in AutomaticIndexStatisticsTest.testStatisticsCorrectness
> --------------------------------------------------------------------------------------
>
> Key: DERBY-5964
> URL: https://issues.apache.org/jira/browse/DERBY-5964
> Project: Derby
> Issue Type: Bug
> Components: Test
> Affects Versions: 10.10.0.0
> Reporter: Knut Anders Hatlen
> Priority: Minor
>
> http://dbtg.foundry.sun.com/derby/test/Daily/jvm1.5/testing/testlog/lin/1402814-suitesAll_diff.txt
> 1) testStatisticsCorrectness(org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStatisticsTest)junit.framework.AssertionFailedError
> at org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStatisticsTest.testStatisticsCorrectness(AutomaticIndexStatisticsTest.java:324)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:117)
> at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:424)
> at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:441)
> at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> at junit.extensions.TestSetup.run(TestSetup.java:25)
> at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> at junit.extensions.TestSetup.run(TestSetup.java:25)
> The failure is caused by this assert:
> assertTrue(s.created.before(now));
> It might be a coincidence, but it happened the same night as Europe was switching from DST.
> It may also be related to DERBY-5046, where a similar assert failed because poor clock resolution made the two timestamps equal.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DERBY-5964) Timestamp comparison failure in
AutomaticIndexStatisticsTest.testStatisticsCorrectness
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13486836#comment-13486836 ]
Knut Anders Hatlen commented on DERBY-5964:
-------------------------------------------
The test checks the value of the CREATIONTIMESTAMP column in SYS.SYSSTATISTICS to find out if the statistics have been updated. The timestamp in that column is stored in the local timezone. However, since Derby doesn't store the timezone offset, timestamps in the hour before the switch from DST to standard time and in the hour after the switch are ambiguous. So when the test fetches a timestamp, say, 2012-10-28 02:30:00 from SYSSTATISTICS, it doesn't know whether that represents 2012-10-28 02:30:00 CEST or 2012-10-28 02:30:00 CET, which both are valid times. The current logic in the Derby engine seems to consistently pick the latter value. This means that if the test runs during the hour before the switch to standard time, it looks as if the statistics are updated one hour into the future, and the test fails.
> Timestamp comparison failure in AutomaticIndexStatisticsTest.testStatisticsCorrectness
> --------------------------------------------------------------------------------------
>
> Key: DERBY-5964
> URL: https://issues.apache.org/jira/browse/DERBY-5964
> Project: Derby
> Issue Type: Bug
> Components: Test
> Affects Versions: 10.10.0.0
> Reporter: Knut Anders Hatlen
> Priority: Minor
>
> http://dbtg.foundry.sun.com/derby/test/Daily/jvm1.5/testing/testlog/lin/1402814-suitesAll_diff.txt
> 1) testStatisticsCorrectness(org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStatisticsTest)junit.framework.AssertionFailedError
> at org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStatisticsTest.testStatisticsCorrectness(AutomaticIndexStatisticsTest.java:324)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:117)
> at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:424)
> at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:441)
> at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> at junit.extensions.TestSetup.run(TestSetup.java:25)
> at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> at junit.extensions.TestSetup.run(TestSetup.java:25)
> The failure is caused by this assert:
> assertTrue(s.created.before(now));
> It might be a coincidence, but it happened the same night as Europe was switching from DST.
> It may also be related to DERBY-5046, where a similar assert failed because poor clock resolution made the two timestamps equal.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (DERBY-5964) Timestamp comparison failure in
AutomaticIndexStatisticsTest.testStatisticsCorrectness
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5964?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Knut Anders Hatlen resolved DERBY-5964.
---------------------------------------
Resolution: Fixed
Fix Version/s: 10.10.0.0
Assignee: Knut Anders Hatlen
Committed revision 1404886.
When DERBY-5974 is fixed, the test can probably stop using TimeZoneTestSetup. But for now, run the test in the GMT time zone.
> Timestamp comparison failure in AutomaticIndexStatisticsTest.testStatisticsCorrectness
> --------------------------------------------------------------------------------------
>
> Key: DERBY-5964
> URL: https://issues.apache.org/jira/browse/DERBY-5964
> Project: Derby
> Issue Type: Bug
> Components: Test
> Affects Versions: 10.10.0.0
> Reporter: Knut Anders Hatlen
> Assignee: Knut Anders Hatlen
> Priority: Minor
> Fix For: 10.10.0.0
>
> Attachments: d5964-1a-run-in-gmt.diff
>
>
> http://dbtg.foundry.sun.com/derby/test/Daily/jvm1.5/testing/testlog/lin/1402814-suitesAll_diff.txt
> 1) testStatisticsCorrectness(org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStatisticsTest)junit.framework.AssertionFailedError
> at org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStatisticsTest.testStatisticsCorrectness(AutomaticIndexStatisticsTest.java:324)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:117)
> at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:424)
> at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:441)
> at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> at junit.extensions.TestSetup.run(TestSetup.java:25)
> at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> at junit.extensions.TestSetup.run(TestSetup.java:25)
> The failure is caused by this assert:
> assertTrue(s.created.before(now));
> It might be a coincidence, but it happened the same night as Europe was switching from DST.
> It may also be related to DERBY-5046, where a similar assert failed because poor clock resolution made the two timestamps equal.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira