Comment 3 for bug 904841

Revision history for this message
Charlie Poole (charlie.poole) wrote :

This turned out to be a race condition between the main test thread and the individual test case thread. In some cases the teardown was run, in others not at all and in still others teardown could start and then be interupted. Inserting a Join in the logic that cancels the thread causes it to work reliably.

The down side of this fix is that any test thread that absolutely refuses to terminate - e.g. by using an infinite loop in the ThreadAbortException handler - will hang up NUnit itself. We'll wait to see if this is a practical problem in the future.