db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Myrna van Lunteren (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5608) BaseTestCase.readProcessOutput should read getInputStream() and getErrorStream() in separate threads
Date Fri, 10 Feb 2012 04:57:59 GMT

    [ https://issues.apache.org/jira/browse/DERBY-5608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13205228#comment-13205228
] 

Myrna van Lunteren commented on DERBY-5608:
-------------------------------------------

I tried a run with a build with the patch applied on the system where the trouble is reproducible,
and unfortunately, I see lots of cascading errors.

It starts with this:
1) test_01_WrongUsage(org.apache.derbyTesting.functionTests.tests.derbynet.NetworkServerControlApiTest)java.lang.InterruptedException
	at java.lang.ProcessImpl.waitFor(Native Method)
	at org.apache.derbyTesting.junit.SpawnedProcess.complete(SpawnedProcess.java:214)
	at org.apache.derbyTesting.junit.SpawnedProcess.complete(SpawnedProcess.java:176)
	at org.apache.derbyTesting.junit.BaseTestCase.readProcessOutput(BaseTestCase.java:774)
	at org.apache.derbyTesting.junit.BaseTestCase.assertExecJavaCmdAsExpected(BaseTestCase.java:508)
	at org.apache.derbyTesting.functionTests.tests.derbynet.NetworkServerControlApiTest.test_01_WrongUsage(NetworkServerControlApiTest.java:81)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
	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)

The next failure is 
2) testBoundaries(org.apache.derbyTesting.functionTests.tests.jdbcapi.InternationalConnectTest)java.sql.SQLException:
DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ001, SQLERRMC: java.security.AccessControlExceptionAccess
denied (java.io.FilePermission [edited path to system dir]\system\AAAAAAAAAAAAAA[...repeat....]AAAA\tmp
delete)XJ001.U
	
The third failure is:
3) shutdownDerby(org.apache.derbyTesting.functionTests.tests.store.BootAllTest)java.lang.NullPointerException
	at org.apache.derby.impl.services.monitor.TopService.getService(TopService.java:128)
	at org.apache.derby.impl.services.monitor.BaseMonitor.shutdown(BaseMonitor.java:199)
	at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:248)
	at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:143)
	at java.sql.DriverManager.getConnection(DriverManager.java:317)
	at java.sql.DriverManager.getConnection(DriverManager.java:297)
	at org.apache.derbyTesting.junit.DriverManagerConnector.getConnectionByAttributes(DriverManagerConnector.java:144)
	at org.apache.derbyTesting.junit.DriverManagerConnector.shutEngine(DriverManagerConnector.java:121)
	at org.apache.derbyTesting.junit.TestConfiguration.shutdownEngine(TestConfiguration.java:1716)
	at org.apache.derbyTesting.functionTests.tests.store.BootAllTest.shutdownDerby(BootAllTest.java:116)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
	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:51)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
	at junit.extensions.TestSetup.run(TestSetup.java:18)
	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:51)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
	at junit.extensions.TestSetup.run(TestSetup.java:18)
	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:51)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
	at junit.extensions.TestSetup.run(TestSetup.java:18)

Which then leaves Derby system shutdown, and causes many, many more failures.
Tests run: 11591,  Failures: 76,  Errors: 817

                
> BaseTestCase.readProcessOutput should read getInputStream()  and getErrorStream() in
separate threads
> -----------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5608
>                 URL: https://issues.apache.org/jira/browse/DERBY-5608
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.9.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-5608-1a-use_spawnedprocess.diff
>
>
> BaseTestCase.readProcessOutput() reads the streams from Process.getInputStream() and
Process.getErrorStream() sequentially 
> InputStream is = pr.getInputStream();
> InputStream es = pr.getErrorStream();
> ...
>  output += "<STDOUT> " + inputStreamToString(is) + "<END STDOUT>\n";
>  output += "<STDERR>" + inputStreamToString(es) + "<END STDERR>\n";
> I think that to be really correct the  two streams need to be read in separate threads
because if the error output  is  large it could block and cause a hang  if they are read sequentially
like this.
> I noticed during the DERBY-5601 discussion as Myrna referenced in that  the addition
of draining the error stream caused a different problem (an InterruptException). I don't understand
how it could cause that problem but do think a hang blocking on  reading the input would be
possible if the error output was large enough both  before and after the change to add the
reading of the error stream sequentially.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message