Comments (8)
That's really strange...I'm not sure where the bug is here. Looking at that method, it appears that a new TaskCompletionSource
is created exactly once and then the handler method is executed on the threadpool once. The SetResult
method is called once in the finally block.
It looks like we need to know what their version of TaskCompletionSource is doing on line 322.
from devices.xunit.
It's probably this line: https://github.com/mono/referencesource/blob/mono/mscorlib/system/threading/Tasks/TaskCompletionSource.cs#L322
from devices.xunit.
One theory: it's hitting SetException is called prior to SetResult and is thus not allowed.... do you see any first chance exceptions logged that might indicate this?
from devices.xunit.
Yep, that line should be TrySetResult
instead of SetResult
, because the latter conflicts with the SetException
call in the catch block.
from devices.xunit.
I've got break on all exceptions turned on, and this exception is the first one to show up :/
Thanks for making the fix @onovotny . Any idea when you'll be releasing to NuGet?
from devices.xunit.
OK, I found the underlying problem. I had a theory with many test cases, but one of them was repeated. For example:
[Theory]
[InlineData("a")]
[InlineData("b")]
[InlineData("c")]
[InlineData("d")]
[InlineData("a")] // oops
[InlineData("e")]
public void theory(string input)
{
}
This was triggering an exception which VS+Xamarin was refusing to show me yesterday:
$exception.StackTrace " at System.ThrowHelper.ThrowArgumentException (ExceptionResource resource) [0x00000] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/throwhelper.cs:74 \n at System.Collections.Generic.Dictionary`2[System.String,Xunit.Runners.TestCaseViewModel].Insert (System.String key, Xunit.Runners.TestCaseViewModel value, Boolean add) [0x0008e] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/collections/generic/dictionary.cs:329 \n at System.Collections.Generic.Dictionary`2[System.String,Xunit.Runners.TestCaseViewModel].Add (System.String key, Xunit.Runners.TestCaseViewModel value) [0x00000] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/collections/generic/dictionary.cs:185 \n at System.Linq.Enumerable.ToDictionary[<>f__AnonymousType0`2,String,TestCaseViewModel] (IEnumerable`1 source, System.Func`2 keySelector, System.Func`2 elementSelector, IEqualityComparer`1 comparer) [0x0002f] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System.Core/System.Linq/Enumerable.cs:2924 \n at System.Linq.Enumerable.ToDictionary[<>f__AnonymousType0`2,String,TestCaseViewModel] (IEnumerable`1 source, System.Func`2 keySelector, System.Func`2 elementSelector) [0x00000] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System.Core/System.Linq/Enumerable.cs:2911 \n at Xunit.Runners.DeviceRunner.RunTestsInAssembly (System.Collections.Generic.List`1 toDispose, Xunit.Runners.AssemblyRunInfo runInfo) [0x00043] in C:\\BuildAgent\\work\\a3e04f08310ca743\\src\\xunit.runner.viewmodels\\DeviceRunner.cs:276 \n at Xunit.Runners.DeviceRunner+<>c__DisplayClass17_1.<RunTests>b__4 (Xunit.Runners.AssemblyRunInfo runInfo) [0x00000] in C:\\BuildAgent\\work\\a3e04f08310ca743\\src\\xunit.runner.viewmodels\\DeviceRunner.cs:243 \n at Xunit.Runners.Extensions.ForEach[AssemblyRunInfo] (IEnumerable`1 This, System.Action`1 action) [0x00010] in C:\\BuildAgent\\work\\a3e04f08310ca743\\src\\xunit.runner.viewmodels\\Utilities\\Extensions.cs:14 \n at Xunit.Runners.DeviceRunner+<>c__DisplayClass17_0.<RunTests>b__0 () [0x0009e] in C:\\BuildAgent\\work\\a3e04f08310ca743\\src\\xunit.runner.viewmodels\\DeviceRunner.cs:242 " string
This was in turn triggering the SetException
call and then subsequently the SetResult
call, which triggered the original exception I mentioned.
Since I've had these tests working successfully in previous xUnit + devices incarnations, it is presumably a change of behavior. Is that right, @bradwilson ?
from devices.xunit.
I just published 1.2.2 with this fix. It was supposed to be 1.2.1 but I mistyped the push from MyGet :(
from devices.xunit.
@onovotny thanks!
from devices.xunit.
Related Issues (20)
- Help with how to use ResultChannel HOT 1
- .txt file not inserted into project on install HOT 1
- iOS 13 can't run test project
- Accessibility problems on Windows Runner
- Testing UWP app fails to start HOT 1
- VS runner does not resolve on netstandard2.0 targets. HOT 2
- Failed MemberData doesn't show in runner app HOT 1
- Visual Studio for Mac
- Extremely poor performance, tests do not complete
- Is Devices.XUnit still be maintained?
- DotNet Maui HOT 1
- Support net6.0+ iOS/Android projects HOT 1
- UWP test runners do not work on Visual Studio 2022 HOT 2
- How do I view/display test results?
- Ability to filter tests HOT 1
- UnitTests from UWP command line
- Device runner for macOS? HOT 6
- Wrong version of xunit.runner.utility.netstandard installed with the latest package version HOT 1
- Test Automation HOT 4
- Templates out of date
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from devices.xunit.