lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless" <>
Subject Re: Exceptions in TestConcurrentMergeScheduler
Date Thu, 04 Oct 2007 08:18:45 GMT

"Chris Hostetter" <> wrote:
> : But it'd be nice to do this across the board, ie, for any junit test
> : if one of CMS's threads (or, threads launched elsewhere) hits an
> : unhandled exception, fail the testcase that's currently running.
> : I'll dig and see if there's some central way to do this with junit...
> FYI: i did some casual investigation of this and the only thing that 
> jumped out at me is the static 
> Thread.setDefaultUncaughtExceptionHandler(...) added in 1.5.  for 1.4 
> there doesn't seem to be a generic way to notice an uncaught exception 
> from any thread.

Thanks Hoss.

Catching the exception is actually not the hard part because I "own"
all the threads spawned by ConcurrentMergeScheduler.  What's tricky is
finding a way to force the currently running JUnit testcase or suite
to fail.  I'm digging through JUnit and ant's JUnitTestRunner sources
to see if there's some hook somewhere where we could insert a check,
just before the suite finishes, to assert that no exceptions were hit.
Or, if I can somehow "look up" the current Test that's running, I
could add an error to it.

If there are any JUnit and ant experts out there (I'm not!) please
chime in!


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

View raw message