db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <knut.hat...@oracle.com>
Subject Re: running SecureServerTest concurrently?
Date Wed, 15 Jun 2011 07:48:30 GMT
Myrna van Lunteren <m.v.lunteren@gmail.com> writes:

> Hi,
>
> I've been stumped by some odd behavior.
> I've been trying to get a number of concurrent suites.All runs (each
> with a different location & jvm & a different value for
> -Dderby.tests.basePort) to go, and apart from an intermittent
> replication test failure, only SecureServerTest fails regularly. So
> I've switched to running only SecureServerTest concurrently (instead
> of suites.All).
>
> I'm using a Windows XP machine, with 2 CPUs, and it has been
> configured to do hyperthreading, so Windows thinks there are 4 CPUs.
>
> I've seen 4 concurrent runs pass, but also seen some of those fail.
>
> The failure seems to be that there's no output coming from the server.
> For instance (running junit.textui.TestRunner with
> -Dderby.tests.trace=true and -Dderby.tests.debug=true):
>
> 1) SecureServerTest( Opened = false, Authenticated= true,
> CustomDerbyProperties= null, WildCardHost= 0.0.0.0
> )junit.framework.AssertionFailedError: Security exceptions in output
> of trace enabling command:
>
> :
> 	at org.apache.derbyTesting.functionTests.tests.derbynet.SecureServerTest.enableTracing(SecureServerTest.java:429)
> 	at org.apache.derbyTesting.functionTests.tests.derbynet.SecureServerTest.testServerStartup(SecureServerTest.java:357)
> 	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:112)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
> 	at junit.extensions.TestSetup.run(TestSetup.java:23)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
> 	at junit.extensions.TestSetup.run(TestSetup.java:23)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
> 	at junit.extensions.TestSetup.run(TestSetup.java:23)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
> 	at junit.extensions.TestSetup.run(TestSetup.java:23)
> 2) SecureServerTest( Opened = true, Authenticated= true,
> CustomDerbyProperties= null, WildCardHost= null
> )junit.framework.AssertionFailedError: Unexpected output in setting
> trace directory:
> 	at org.apache.derbyTesting.functionTests.tests.derbynet.SecureServerTest.setTraceDirectory(SecureServerTest.java:380)
> 	at org.apache.derbyTesting.functionTests.tests.derbynet.SecureServerTest.testServerStartup(SecureServerTest.java:358)
> 	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:112)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
> 	at junit.extensions.TestSetup.run(TestSetup.java:23)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
> 	at junit.extensions.TestSetup.run(TestSetup.java:23)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
> 	at junit.extensions.TestSetup.run(TestSetup.java:23)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
> 	at junit.extensions.TestSetup.run(TestSetup.java:23)
>
> I've tried thought that perhaps there should be some more time between
> the runServerCommand and the check, so I added Thread.sleep(200) after
> every call, but that didn't help.
> I've also tried to change
> org.apache.derbyTesting.junit.SpawnedProcess.getFullServerOutput()  to
> return this:
>  return "out: " +  out.toString() + "\nerr: " + err.toString() ;
> But the contents were still empty, and err.toString never has anything.
>
> If anyone has any suggestions/hints on what might be wrong, or other
> things to experiment with, please let me know...

The thread that drains the output from the process runs at minimum
priority (Thread.MIN_PRIORITY). Perhaps it just takes a very long time
for it to get the CPU cycles it needs to do its work. Instead of
sleeping for an arbitrary amount of time in getFullServerOutput(), it
might be more robust to call join() on the streamReader thread before
extracting the string from the ByteArrayOutputStream.

Also, I don't think there's a very good reason for running the thread at
minimum priority, since we depend on its completion within reasonable
time.

-- 
Knut Anders

Mime
View raw message