[
https://issues.apache.org/jira/browse/DERBY-6701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14093964#comment-14093964
]
Knut Anders Hatlen commented on DERBY-6701:
-------------------------------------------
It sounds likely that the cause of the failure is the same as DERBY-1455. There
is a race condition between the server logic that closes sessions for
disconnected clients, and the test code that calls getRuntimeInfo().
When a client closes a connection, it doesn't send a "close connection" command
to the server and block till the server has done the cleanup. It just closes
the socket, and goes on to it's next tasks. The server thread doesn't clean up
the session until it gets an exception when reading from the socket, so the
client may already have called getRuntimeInfo() before the session is removed.
Waiting longer in the test before calling getRuntimeInfo() makes it less likely
to fail. But it's hard to tell how long is long enough. And increasing the
length of the nap makes the test use longer time even in the common case where
a nap is not needed. Maybe we could add some retry logic that keeps calling
getRuntimeInfo() until it returns the expected output. Then we wouldn't need to
sleep in the common case, and we'd sleep as long as necessary in the cases
where the session cleanup code loses the race.
> Instability in RuntimeInfoTest.x_testRuntimeInfoAfterConnClose
> --------------------------------------------------------------
>
> Key: DERBY-6701
> URL: https://issues.apache.org/jira/browse/DERBY-6701
> Project: Derby
> Issue Type: Bug
> Components: Test
> Affects Versions: 10.11.1.1, 10.12.0.0
> Environment: mac osx 10.7.5, jdk1.8.0-b132
> Reporter: Rick Hillegas
> Attachments: derby-6701-01-aa-increaseSleepTime.diff
>
>
> I have seen variations of the following error twice in the past 2 days: once
> on the 10.12 trunk while testing the fix to derby-6692 and then again on the
> 10.11.1.1 release candidate while running the tests without the Lucene jar
> files.
> {noformat}
> 1)
> testRunTests(org.apache.derbyTesting.functionTests.tests.derbynet.RuntimeInfoTest)junit.framework.ComparisonFailure:
> Output doesn't match expected:<...-----
> Sessionnummer:[8
> -------------------------------------------------------------
> Anzahl Verbindungsthreads: 4
> Anzahl aktive Sessions: 1]
> Anzahl wartende Ses...> but was:<...-----
> Sessionnummer:[5
> Datenbank:singleUse/oneuse5
> Benutzer:APP
> Anzahl Anweisungen:2
> Informationen zur vorbereiteten Anweisung:
> Anwsg-ID SQL-Text
> ------------- -----------
> null
> null
> Sessionnummer:8
> -------------------------------------------------------------
> Anzahl Verbindungsthreads: 4
> Anzahl aktive Sessions: 2]
> Anzahl wartende Ses...>
> at
> org.apache.derbyTesting.functionTests.tests.derbynet.RuntimeInfoTest.x_testRuntimeInfoAfterConnClose(RuntimeInfoTest.java:192)
> at
> org.apache.derbyTesting.functionTests.tests.derbynet.RuntimeInfoTest.testRunTests(RuntimeInfoTest.java:97)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at
> org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:118)
> at
> org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:440)
> at
> org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:457)
> 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 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 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)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.2#6252)