Multi Threaded Unit Tests with Osherove.ThreadTester

My blog has moved. You can view this post at the following address: http://www.osherove.com/blog/2007/6/22/multi-threaded-unit-tests-with-osherovethreadtester.html
Published Friday, June 22, 2007 12:28 PM by RoyOsherove

Comments

Friday, June 22, 2007 12:45 PM by Tom Opgenorth

# re: Multi Threaded Unit Tests with Osherove.ThreadTester

A thousand thanks for this!  I'm soon to be needing this on my current project.

Sunday, June 24, 2007 2:53 AM by Gil Zilberfeld

# re: Multi Threaded Unit Tests with Osherove.ThreadTester

Roy,

I wish I had this a year ago. I then wrote something a lot more primitive than this for checking timeouts and race conditions.

Well done.

Gil

Sunday, June 24, 2007 5:07 AM by RoyOsherove

# re: Multi Threaded Unit Tests with Osherove.ThreadTester

Hermann: I'd love to see it.

I thought about going that route, but it seemed too.. non intuitive, but I'd love to get my hands on that.

Roy

Sunday, June 24, 2007 11:32 AM by RoyOsherove

# re: Multi Threaded Unit Tests with Osherove.ThreadTester

Hermann: I'm always reachable at :

Roy at osherove.com

Monday, June 25, 2007 3:01 PM by Tom Opgenorth

# re: Multi Threaded Unit Tests with Osherove.ThreadTester

I notice the reference to Mono.Cecil in your Tests folder.  Is this necessary?  When I removed the reference (and the UsingCecil tests), everything still seemed to compile okay.

Monday, June 25, 2007 6:24 PM by RoyOsherove

# re: Multi Threaded Unit Tests with Osherove.ThreadTester

Tom: The Cecil is just something I've been playing with. There is no dependency on Cecil at the moment (and I don't see anhy for the near future)

Monday, July 16, 2007 1:07 PM by Greg

# re: Multi Threaded Unit Tests with Osherove.ThreadTester

I've done this a couple of times, but much less general. I've been going to put something reusable together but you've beat me to it and done it well. Thanks Roy!

Thursday, August 2, 2007 11:40 AM by Ben

# re: Multi Threaded Unit Tests with Osherove.ThreadTester

Great little abstraction. Perfect for my needs.

Just a note FYI:

Some of the source classes have a "using NUnit.Framework" statement which isn't being used and as such if not installed on the clients machine throws an exception at runtime.

Also, the "public void StartAllThreads(int runningTimeout)" method has a dependency on NUnit which it doesn't need to... Just throw an exception instead of doing an NUnit.AssertFail().

Once again, great work.