You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SetUpFixture causes NUnit to lock with Apartment( STA ) #2534
Having both [assembly: Apartment( ApartmentState.STA )] and a type marked as [SetUpFixture] in a test project will cause the tests to lock up. Reproductible with both the NUnit console runner and R# test runner.
The Apartment attribute may be defined on either assembly level or type level with the same results.
> ..\..\..\packages\NUnit.ConsoleRunner.3.7.0\tools\nunit3-console.exe STATest.dll
NUnit Console Runner 3.7.0
Copyright (c) 2017 Charlie Poole, Rob Prouse
Runtime Environment
OS Version: Microsoft Windows NT 10.0.15063.0
CLR Version: 4.0.30319.42000
Test Files
STATest.dll
I'm probably doing something wrong. The only version of NUnit I can see over at that feed when I add it to Visual Studio package manager settings is 2.6.4 from October 2015.
Also seems to fix the issue. Tested with both the assembly level attribute, which doesn't hang but leaves the threads MTA and class level attribute, which also hanged previously but doesn't anymore and actually changes the thread to STA.
Activity
ChrisMaddock commentedon Nov 6, 2017
Will you try pulling in the latest build of master, which you can get from our MyGet feed?
https://www.myget.org/F/nunit/api/v2
I'd expect that this will currently no longer hang, but will run as MTA rather than STA. The fix for that half of the issue is in progress here: #2519
Rantanen commentedon Nov 6, 2017
I'm probably doing something wrong. The only version of NUnit I can see over at that feed when I add it to Visual Studio package manager settings is 2.6.4 from October 2015.
mikkelbu commentedon Nov 6, 2017
@Rantanen You can get it from here https://www.myget.org/feed/nunit/package/nuget/NUnit
ChrisMaddock commentedon Nov 6, 2017
@Rantanen - I'm guessing you missed ticking the 'show pre-release' box? 🙂
Rantanen commentedon Nov 6, 2017
Dammit. I was searching for similar box somewhere on the right side in the package manager UI. Not next to the search box. :)
Got it from @mikkelbu's link anyway, thanks.
Also seems to fix the issue. Tested with both the assembly level attribute, which doesn't hang but leaves the threads MTA and class level attribute, which also hanged previously but doesn't anymore and actually changes the thread to STA.
Rantanen commentedon Nov 6, 2017
So if that's a master build that means this is already fixed in master and can be closed, right?
ChrisMaddock commentedon Nov 6, 2017
Great - thanks for confirming! FYI, 3.9 should be out with the fix soonish, so long as there's no more major issues.