Re: Multiple threading [Test] question

"Kelly Anderson" <[email protected]> Fri, 12 Sep 2008 18:10:58 -0600
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <[email protected]>
On Fri, Sep 12, 2008 at 12:45 PM, Charlie Poole
<[email protected]> wrote:
> Hi Kelly,
>
>> If you run a [Test] and it spawns off another thread, and
>> that thread throws an exception, does the root Test catch
>> that exception?
>
> No. This is the fundametal problem of testing apps that
> spawn threads.
>
>> Is such behavior even possible?
>
> Using managed code, it's not possible to catch and correcty
> handle arbitrary exceptions thrown by threads that NUnit doesn't
> actually know about.
>
> For the more limited situation where the test creates the thread,
> you can arrange to catch exceptions and pass them on to NUnit.
> It would be possible for the framework to provide a method
> for spawning threads that did this for you. But if the thread
> is created in the app under test, there's no way in the
> current architecture.
>
> This is one of the primary reasons I've been talking about
> really big architectural changes for 3.0.

That's sort of where I thought this would go. Do you think that there
is a possibility of fixing this even with massive architectural
changes?

-Kelly

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/