vs-mef icon indicating copy to clipboard operation
vs-mef copied to clipboard

Unstable test: LazyOfSharedPartConstructsOnlyOneInstanceAcrossThreads

Open AArnott opened this issue 7 years ago • 5 comments

The LazyOfSharedPartConstructsOnlyOneInstanceAcrossThreads test has failed in at least two different builds.

See one such failure here:

   V1 [FAIL]
      Assert.Equal() Failure
      Expected: 1
      Actual:   2
      Stack Trace:
        src\tests\Microsoft.VisualStudio.Composition.Tests\ThreadSafetyTests.cs(82,0): at Microsoft.VisualStudio.Composition.Tests.ThreadSafetyTests.<LazyOfSharedPartConstructsOnlyOneInstanceAcrossThreads>d__3.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
    V2 [FAIL]
      Assert.Equal() Failure
      Expected: 1
      Actual:   2
      Stack Trace:
        src\tests\Microsoft.VisualStudio.Composition.Tests\ThreadSafetyTests.cs(82,0): at Microsoft.VisualStudio.Composition.Tests.ThreadSafetyTests.<LazyOfSharedPartConstructsOnlyOneInstanceAcrossThreads>d__3.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult()

AArnott avatar Jun 16 '17 15:06 AArnott

I believe it's due to a race condition with another instance of itself (V1 and V2 are the failing instances). Either that, or the V1 and V2 engines are not as thread-safe as they should be.

AArnott avatar Jun 16 '17 15:06 AArnott

I just saw this again on a local test run. But it was just the V1 engine.

AArnott avatar Oct 01 '17 01:10 AArnott

Saw this again on the V3 engine on Travis CI

[xUnit.net 00:00:32.0749274]     V3 engine (Slow reflection) [FAIL]
[xUnit.net 00:00:32.0779787]       Assert.Equal() Failure
[xUnit.net 00:00:32.0786734]       Expected: 1
[xUnit.net 00:00:32.0792559]       Actual:   2
[xUnit.net 00:00:32.0815537]       Stack Trace:
[xUnit.net 00:00:32.1123327]         /home/travis/build/Microsoft/vs-mef/src/tests/Microsoft.VisualStudio.Composition.Tests/ThreadSafetyTests.cs(86,0): at Microsoft.VisualStudio.Composition.Tests.ThreadSafetyTests.<LazyOfSharedPartConstructsOnlyOneInstanceAcrossThreads>d__3.MoveNext()
[xUnit.net 00:00:32.1124684]         --- End of stack trace from previous location where exception was thrown ---
[xUnit.net 00:00:32.1125277]            at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
[xUnit.net 00:00:32.1125865]            at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[xUnit.net 00:00:32.1126200]         --- End of stack trace from previous location where exception was thrown ---
[xUnit.net 00:00:32.1126582]            at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
[xUnit.net 00:00:32.1126992]            at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[xUnit.net 00:00:32.1127287]         --- End of stack trace from previous location where exception was thrown ---
[xUnit.net 00:00:32.1127660]            at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
[xUnit.net 00:00:32.1128039]            at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Failed   V3 engine (Slow reflection)
Error Message:
 Assert.Equal() Failure
Expected: 1
Actual:   2
Stack Trace:
   at Microsoft.VisualStudio.Composition.Tests.ThreadSafetyTests.<LazyOfSharedPartConstructsOnlyOneInstanceAcrossThreads>d__3.MoveNext() in /home/travis/build/Microsoft/vs-mef/src/tests/Microsoft.VisualStudio.Composition.Tests/ThreadSafetyTests.cs:line 86
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

AArnott avatar Apr 18 '18 05:04 AArnott

This happened twice in a row on Travis CI just now. Both were building the very benign #84 PR.

AArnott avatar Apr 18 '18 05:04 AArnott

Saw this again on Travis CI:

AArnott avatar Jun 07 '18 04:06 AArnott