[
https://issues.apache.org/jira/browse/DERBY-6280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13911010#comment-13911010
]
Myrna van Lunteren commented on DERBY-6280:
-------------------------------------------
After puzzling over the expected timeouts but not getting them, I am still
puzzled.
If I understand correctly, the test sets the QueryTimeout to 1 (second). Then
it executes a query which calls the delay(int,int) method which causes a sleep
of 1 second, for every row, and there are 6 rows, so this should take 6 seconds.
The interesting part is that we so far have seen this only fail on one
particular vmware machine.
The method setting up the query, getFetchQuery, has the following comment:
/**
* The reason for using the mod function here is to force
* at least one invocation of ResultSet.next() to read
* more than one row from the table before returning.
* This is necessary since timeout is checked only when
* reading rows from base tables, and when the first row
* is read, the query still has not exceeded the timeout.
We also see the following comment in one of the oldest parts of the test:
* Actually, there is no guarantee that setting a query timeout
* for a statement will actually cause a timeout, even if execution
* of the statement takes longer than the specified timeout.
So, I currently have 2 theories.
1. The test failures occur on a machine which is running vmware with a bug in
it, so that it doesn't handle the time elapsing correctly.
2. This machine is occasionally extra-super-duper fast and then especially when
JIT kicks in it manages to get more rows through before it gets to checking the
timeout.
I think the best I can do at this time is to improve the error messages.
> test failure in SetQueryTimeoutTest ComparisonFailure: Output at line 16
> expected:<Test[ing that PreparedStatement remembers timeout.]> but was:<Test[
> SetQueryTimeoutTest FAILED]>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-6280
> URL: https://issues.apache.org/jira/browse/DERBY-6280
> Project: Derby
> Issue Type: Bug
> Components: Test
> Affects Versions: 10.10.1.4
> Environment: win(on vmware), ibm16
> Reporter: Myrna van Lunteren
>
> build:
> 10.10.1.3 - (1495273)
> see:
> http://people.apache.org/~myrnavl/derby_test_results/v10_10/windows/testlog/ibm16/1495273-suites.All_diff.txt
> stack trace:
> 1)
> SetQueryTimeoutTest(org.apache.derbyTesting.functionTests.tests.jdbcapi.JDBCHarnessJavaTest)junit.framework.ComparisonFailure:
> Output at line 16 expected:<Test[ing that PreparedStatement remembers
> timeout.]> but was:<Test[ SetQueryTimeoutTest FAILED]>
> at
> org.apache.derbyTesting.functionTests.util.CanonTestCase.compareCanon(CanonTestCase.java:109)
> at
> org.apache.derbyTesting.functionTests.util.HarnessJavaTest.runTest(HarnessJavaTest.java:91)
> at
> org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:117)
> at
> org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:442)
> at
> org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:459)
> 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 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)
> at
> org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)