RFC: Harness with no busy-waiting
Anthony Balkissoon
abalkiss@redhat.com
Tue Jun 27 19:04:00 GMT 2006
On Tue, 2006-06-27 at 10:41 +0200, Mark Wielaard wrote:
> Hi Anthony,
>
> On Mon, 2006-06-26 at 15:27 -0400, Anthony Balkissoon wrote:
> > This removes the busy waiting from the Harness and replaces it with
> > blocking read() calls using Sockets with specified timeouts.
> >
> > This is RFC because I'd like it to be tested to see if it speeds things
> > up as much as Mark's workaround before it is checked in.
>
> I don't really like this design. It puts even more stuff inside the
> RunnerProcess which really should be as simple as possible so you can
> easily run and debug it. Otherwise you might be trying to debug the
> infrastructure and not the test itself. And by adding Sockets you a also
> make it very hard/impossible to run single tests without the Harness to
> really debug them. Please just use normal streams for communication
> between the RunnerProcess and whatever calls it. And add a old-fashion
> timeout with Object.wait()/notify() to the Harness, or if you want
> something more fancy there add a nio.channel.Selector. But please don't
> make the RunnerProcess depend on too much infrastructure.
>
> Cheers,
>
> Mark
>
Okay, here's a second attempt, no Sockets, no tricks. Still RFC.
Comments?
2006-06-27 Anthony Balkissoon <abalkiss@redhat.com>
* Harness.java:
(bcp_timeout): Removed this field.
(testIsHung): Likewise.
(runner_lock): Likewise.
(getClasspathInstallString): Return an empty string instead of null
when no bootclasspath is detected.
(getBootClassPath): Removed the TimeoutWatcher and replaced the busy
waiting with a blocking readLine().
(runTest): Redesigned to replace busy waiting with blocking readLine()
call.
(TimeoutWatcher.run): If the timeout occurs, kill the RunnerProcess and
restart it instead of notifying the Harness and letting the Harness do
the work.
(DetectBootclasspath.main): If the bootclasspath isn't detectable,
return a String saying so.
* RunnerProcess.java:
(FAILED_TO_LOAD_DESCRIPTION): New field.
(UNCAUGHT_EXCEPTION_DESCRIPTION): Likewise.
(main): If the testname is null, call System.exit.
(runtest): Set the description earlier to avoid NPE. Handle loading
exceptions and uncaught exceptions better.
(runAndReport): Handle loading exceptions and uncaught exceptions.
--Tony
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RemoveBusyWait2.diff
Type: text/x-patch
Size: 16170 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/mauve-patches/attachments/20060627/4fe7397b/attachment.bin>
More information about the Mauve-patches
mailing list