ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Testlistener Events in JUnit Slows Down Forked Tests in 1.8.x
Date Tue, 10 Aug 2010 19:45:38 GMT
On 2010-08-10, Danny Yates wrote:

> Why does the StreamPumper poll like that?

So it can be interrupted.

> Surely it should just block reading the InputStream?

It used to do just that.

On Windows if a process spawns children (grandchildren of Ant in this
case) they inherit the streams of their parent.  In cases where a
process forked by Ant spawns new processes and then finishs Ant would
wait for the grandchildren which is not desired.  Instead we want Ant to
go on once the forked process is done.

> To deal with InterruptedException, you can just do a timed read and
> test the interrupted flag before looping back to the blocking read.

I'm not sure I follow you here.  Are you talking about NIO's Selector
with "timed read"?  When Ant was changed to use polling we still lived
in Java 1.3 API land and so never looked at NIO options.  I'm afraid the
InputStreams provided by the Process class won't provide
SelectableChannels, though.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message