The latest version of the NUnit addin (0.5.120) makes it
is impossible to run our existing multithreading tests.
With a previous version of the addin (0.2.24), which is
not compatible with .Net 1.1, we didn't had such a
problem. The problem is specific for this version of this
Addin. When use the NUnit console from the command
line we do have this problem.
A concrete example:
test main thread starts in parallel 50 threads using the
System.Threading.ThreadPool.QueueUserWorkItemMethod
(CallBack, Object)
and waits until all 50 threads are finished using
System.Threads.WaitHandle.WaitAll(waithandles,
timeout, exitContext)
We get the following exception:
System.NotSupportedException : WaitAll for multiple
handles on an STA thread is not supported.
This is probably because NUnit addin now runs in the
context of a windows application (it has a form attached
to it, as these are restricted to STA).
Logged In: YES
user_id=619229
The add-in still runs with a STA thread. This is deliberate as
more things seem to break when not running as an STA than
when running as a STA. You could always kick off another
thread to do these tests. Let me know if you can think of
any other solutions.
The other issue is that the NUnit GUI runs tests on a STA
thread. I want to keep the add-in as similar to the GUI as
possible (to avoid any surprise failing tests). Maybe
something could be done in the test project config file.