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

Improve CreationSpecsBase test hierarchy's threadsafety #1069

Closed
blairconrad opened this issue Apr 25, 2017 · 2 comments
Closed

Improve CreationSpecsBase test hierarchy's threadsafety #1069

blairconrad opened this issue Apr 25, 2017 · 2 comments

Comments

@blairconrad
Copy link
Member

blairconrad commented Apr 25, 2017

At least one test (a spec) fails, due to what appears to be a use of shared state:

      System.InvalidOperationException : Collection was modified; enumeration operation may not execute.
build.cmd :     FakeItEasy.Specs.GenericCreationSpecs.UseSuccessfulConstructor() [08] And the one-parameter constructor was not tried [FAIL]
At line:4 char:5
+     & .\build.cmd
+     ~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (    FakeItEasy....ot tried [FAIL]:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
      Stack Trace:
           at System.Collections.Generic.SortedSet`1.Enumerator.MoveNext()
           at System.Linq.Enumerable.<CastIterator>d__29`1.MoveNext()
           at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
           at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
        C:\projects\fluentassertions-vf06b\Src\Core\Collections\CollectionAssertions.cs(335,0): at FluentAssertions.Collections.CollectionAssertions`2.BeEquivalentTo[T](IEnumerable`1 expected, String because, Object[] becauseArgs)
        C:\projects\fakeiteasy\tests\FakeItEasy.Specs\CreationSpecs.cs(74,0): at FakeItEasy.Specs.CreationSpecsBase.<>c.<UseSuccessfulConstructor>b__2_6()
        C:\projects\xbehave-net\src\Xbehave.Core\StringExtensions.cs(36,0): at Xbehave.StringExtensions.<>c__DisplayClass0_0.<x>b__0(IStepContext c)
        C:\projects\xbehave-net\src\Xbehave.Execution\StepInvoker.cs(75,0): at Xbehave.Execution.StepInvoker.<>c__DisplayClass8_1.<<InvokeBodyAsync>b__1>d.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
@blairconrad
Copy link
Member Author

blairconrad commented Apr 25, 2017

I took a very quick gander, and CreationSpecsBase (and classes extending it) look like the only offender(s).

@blairconrad blairconrad changed the title Improve tests' threadsafety Improve CreationSpecsBase test hierarchy's threadsafety Apr 25, 2017
@blairconrad blairconrad added this to the 3.3.0 milestone Apr 26, 2017
@blairconrad
Copy link
Member Author

This issue was fixed in Release 3.3.0.

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

No branches or pull requests

3 participants