On 4/11/2014 9:36 AM, Weijun Wang wrote: > > > On 4/11/2014 7:10, Xuelei Fan wrote: >>> What does that thread.join(120000) do? Is it possible that after it >>> finishes no exception was thrown yet and your test shown as succeeded? >>> >> IO exception should be thrown when the client cannot read and write. > > This is what I am worried about: > > Suppose serverThread.join(120000) timeouts. At this time, somewhere > inside server thread is waiting. Now the main thread starts executing > lines 374- This line (374) will not be able to get executed until the client finished its job (line 347).
When line 374 get called, the test is nearly done (client complete its jobs, and server accepted all connections). serverThread.join(120000) is just want to make sure that if the termination of this thread is not scheduled to complete within the overall testing timeout, it can be better controlled here. Actually, there are four server threads in this test. Only the latest one is joined. It's not a good practice. But as the update to re-org the test is huge, I don't want to touch this point this time. Thanks, Xuelei > and since no exception has been thrown it will execute to > line 416 and the main thread exits without a problem. After a while, the > server thread fails but since its exception is stored in a variable > (serverException) and not thrown out, the test seems to pass. > > Why are thread.join() necessary? Except for socket timeout, are you > expecting other calls spending too much time? > > --Max > >> >> Thanks, >> Xuelei > >> >>>>> http://cr.openjdk.java.net/~xuelei/8037557/webrev.00/