[ http://issues.apache.org/jira/browse/DERBY-1878?page=all ]

Sunitha Kambhampati updated DERBY-1878:
---------------------------------------

    Attachment: derby1878.diff.txt
                derby1878.stat.txt

I am attaching the patch (derby1878.diff.txt) to improve some error handling in 
some of the network server tests. 

1.The execCmdDumpResults used by the five tests 
timeslice.java,maxthreads.java,testij.java,runtimeinfo.java,sysinfo.java suffer 
from the same problems that was fixed for testProperties.java namely 
        -- the outputstream for the sub process's is not flushed out 
        -- there is no timeout handling for the ProcessStreamResult
2.Eliminate duplication of code in these 5 tests for 
execCmdDumpResults(String[] args) method.  The execCmdDumpResults method 
basically exec's a new process and then waits for the process to dump the 
results. A new utility class - ExecProcUtil is added with execCmdDumpResults 
that is generalized to take the necessary input from the tests as well as fixes 
the issues mentioned in #1.   The OutputStream is flushed out by calling 
bos.flush and System.out.flush and the timeout is added for 
ProcessStreamResult. 
3.Make use of the TimedProcess to kill process if process does not exit within 
the timeout period.
4.TestConnection.java test has some variation of the execCmdDumpResults and it 
also adds some testcases into this method. Hence this method in this test is 
left as is and timeout handling is added. 
5.testij.out has been updated. The previous master file was eating away the 
last line that was written to System.out, but now that the process's streams 
are flushed properly, the last line in testij.out test which prints out 'End 
test' 
is also seen in the output file. 

Also noticed that these tests - like timeslice.java, maxthreads.java all seem 
to set the properties for the server and then check if the property is set. The 
functionality of the server when these properties is set is not being tested. 
It will be good to add tests that test that the functionality itself is working 
as expected or not. Please note, recently connecting to server with timeslice 
options discovered some issues with server (see DERBY-1856).

This is a test only change for network server. derbyall on windows/jdk142 ran 
ok with no failures. 

Can someone please review this patch. Thanks.


> Improve error handling in network server tests
> ----------------------------------------------
>
>                 Key: DERBY-1878
>                 URL: http://issues.apache.org/jira/browse/DERBY-1878
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Sunitha Kambhampati
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: derby1878.diff.txt, derby1878.stat.txt
>
>
> Some network server tests (specially those that spawn new process) have bad 
> error handling that results in the test hanging forever if it fails, thus 
> holding up execution of a nightly test run.    The tests must timeout instead 
> of hanging forever if it fails. 
> Please see http://issues.apache.org/jira/browse/DERBY-1694#action_12435129  
> for some possible improvements. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to