Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unstable test: LazyOfSharedPartConstructsOnlyOneInstanceAcrossThreads #22

Open
AArnott opened this issue Jun 16, 2017 · 5 comments
Open

Comments

@AArnott
Copy link
Member

AArnott commented Jun 16, 2017

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 added a commit that referenced this issue Jun 16, 2017
@AArnott
Copy link
Member Author

AArnott commented Jun 16, 2017

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
Copy link
Member Author

AArnott commented Oct 1, 2017

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

AArnott added a commit that referenced this issue Oct 2, 2017
@AArnott AArnott closed this as completed Oct 2, 2017
@AArnott
Copy link
Member Author

AArnott commented Apr 18, 2018

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 AArnott reopened this Apr 18, 2018
@AArnott
Copy link
Member Author

AArnott commented Apr 18, 2018

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

@AArnott
Copy link
Member Author

AArnott commented Jun 7, 2018

Saw this again on Travis CI:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant