Re: Threadstatic Problem

"Charlie Poole" <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <003601c89995$985f5320$6401a8c0@ferrari>
Hi Robbie,
 
If I'm understanding correcty, you are creating a thread in your test and
running some code on it. Since
NUnit has already run the setup at that point, there's not much to do about
it. If I'm misunderstanding,
please follow up and I'll try again.
 
Charlie

  _____  

From: [email protected]
[mailto:[email protected]] On Behalf Of
[email protected]
Sent: Tuesday, April 08, 2008 8:20 AM
To: [email protected]
Subject: [Nunit-users] Threadstatic Problem



We're seeing a strange problem with some unit tests to do with NUnit's Setup
and Teardown methods.  The global setup and teardown (TestFixtureSetUp,
TestFixtureTearDown) gets executed on the primary thread.  However if the
test case is run on a secondary thread the function level setup/teardown
(Setup, Teardown) are called on the primary thread. 

 

This is resulting (in what looks like) a problem with a [ThreadStatic]
attribute as the function level teardown can't touch it correctly because
it's on a separate thread.

 

Should the function level setup/teardown methods be called on the functions
thread and not the primary?  Or am I not understanding something properly
(likely J)

 

Thanks,

 


____________________________________________________________________
DISCLAIMER

This message and any attachments contain privileged and confidential
information intended for the use of the addressee named above. If you are
not the intended recipient of this message, you are hereby notified that any
use, dissemination, distribution or reproduction of this message is
prohibited. Please note that we cannot guarantee that this message or any
attachment is virus free or that it has not been intercepted and amended.
The views of the author may not necessarily reflect those of Realtime Worlds
Ltd.



Realtime Worlds Ltd is registered in Scotland, number 225628. Registered
Office: 152 West Marketgait, Dundee, DD1 1NJ.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

_______________________________________________
Nunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nunit-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.