Skip to content
This repository was archived by the owner on Dec 12, 2017. It is now read-only.
This repository was archived by the owner on Dec 12, 2017. It is now read-only.

Failing test never completes #50

@mbp

Description

@mbp

I have a strange issue after updating to "xUnit.net Test Support 2.1.6"

I use Visual Studio, ReSharper 8.2.3, xUnit 1.9.2 and FluentAssertions 3.3.0.

The following test never completes:

[Fact]
public void Failing_Test_Never_Completes()
{
    var oneList = new List<MyDto>
    {
        new MyDto
        {
            Id = 42,
        }
    };
    var secondList = new List<MyDto>
    {
        new MyDto
        {
            Id = 44,
        },
    };

    oneList.ShouldAllBeEquivalentTo(secondList);
}

When I debug the test, it appears a TargetInvocationException is thrown from xUnit, which I tracked down to IndexOutOfRangeException in the following stack trace:

at XunitContrib.Runner.ReSharper.RemoteRunner.AbstractionExtensions.ConvertExceptions(IFailureInformation failure, String& simplifiedMessage)
at XunitContrib.Runner.ReSharper.RemoteRunner.TestExecutionVisitor.Visit(ITestFailed testFailed)
at Xunit.TestMessageVisitor.DoVisit[TMessage](IMessageSinkMessage message, Func`2 callback)
at Xunit.TestMessageVisitor.OnMessage(IMessageSinkMessage message)
at Xunit.TestMessageVisitor`1.OnMessage(IMessageSinkMessage message)
at XunitContrib.Runner.ReSharper.RemoteRunner.TestExecutionVisitor.OnMessage(IMessageSinkMessage message)
at Xunit.TestClassCallbackHandler.OnTest(XmlNode xml)
at Xunit.TestClassCallbackHandler.OnXmlNode(XmlNode xml)
at Xunit.XmlNodeCallbackHandler.System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent(String eventArgument)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

In the call stack, I found a variable with the following XML, thought it might be relevant.

<test name="ConsoleApplication7.MyTest.Failing_Test_Never_Completes" type="ConsoleApplication7.MyTest" method="Failing_Test_Never_Completes" result="Fail" time="0.698"><failure exception-type="Xunit.Sdk.AssertException"><message>Expected item[0].Id to be 44, but found 42.

With configuration:
- Use declared types and members
- Compare enums by value
- Match member by name (or throw)
- Be strict about the order of items in byte arrays
</message><stack-trace>   ved FluentAssertions.Execution.LateBoundTestFramework.Throw(String message) i z:\Builds\work\b7ceef20fdfcf0ee\Shared\Execution\LateBoundTestFramework.cs:linje 30
   ved FluentAssertions.Execution.TestFrameworkProvider.Throw(String message) i z:\Builds\work\b7ceef20fdfcf0ee\FluentAssertions.Net40\Execution\TestFrameworkProvider.cs:linje 42
   ved FluentAssertions.Execution.CollectingAssertionStrategy.ThrowIfAny(IDictionary`2 context) i z:\Builds\work\b7ceef20fdfcf0ee\FluentAssertions.Core\Execution\CollectingAssertionStrategy.cs:linje 50
   ved FluentAssertions.Execution.AssertionScope.Dispose() i z:\Builds\work\b7ceef20fdfcf0ee\FluentAssertions.Core\Execution\AssertionScope.cs:linje 252
   ved FluentAssertions.Equivalency.EquivalencyValidator.AssertEquality(EquivalencyValidationContext context) i z:\Builds\work\b7ceef20fdfcf0ee\FluentAssertions.Core\Equivalency\EquivalencyValidator.cs:linje 36
   ved FluentAssertions.AssertionExtensions.ShouldBeEquivalentTo[T](T subject, Object expectation, Func`2 config, String because, Object[] reasonArgs) i z:\Builds\work\b7ceef20fdfcf0ee\Shared\AssertionExtensions.cs:linje 542
   ved FluentAssertions.AssertionExtensions.ShouldBeEquivalentTo[T](T subject, Object expectation, String because, Object[] reasonArgs) i z:\Builds\work\b7ceef20fdfcf0ee\Shared\AssertionExtensions.cs:linje 503
   ved FluentAssertions.AssertionExtensions.ShouldAllBeEquivalentTo[T](IEnumerable`1 subject, IEnumerable expectation, String because, Object[] reasonArgs) i z:\Builds\work\b7ceef20fdfcf0ee\Shared\AssertionExtensions.cs:linje 567
   ved ConsoleApplication7.MyTest.Failing_Test_Never_Completes() i c:\Users\mbp\Documents\Visual Studio 2013\Projects\ConsoleApplication7\ConsoleApplication7\Program.cs:linje 34</stack-trace></failure></test>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions