-
Notifications
You must be signed in to change notification settings - Fork 100
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
Race condition in FillerManager.cs GetFiller(PropertyInfo propertyInfo) #132
Comments
Fixed this temporarily on my site by wrapping entire body of GetFilter() into a lock(){...} block. |
We used to get this on the GenFu unit tests. Our workaround for the time being was to disable parallel tests |
Please check PR #133. |
Hi @dpaquette. I've got some tests failing randomly because of the problem listed in this issue. I'd rather prefer not disabling the parallel tests. Running them in parallel increases my confidence in the whole system and is more performant. The provided PR #133 solves this issue and is more performant than just a lock because it uses reader and writer locks. Had you the opportunity to check it out? |
When executing in parallel (unit testing) I get following Exception:
Result StackTrace:
----- Inner Stack Trace #1 (System.ArgumentException) -----
at System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException(Object key)
at System.Collections.Generic.Dictionary
2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Collections.Generic.Dictionary
2.Add(TKey key, TValue value)at GenFu.FillerManager.GetFiller(PropertyInfo propertyInfo) in C:\james\code\GenFu\src\GenFu\FillerManager.cs:line 165
at GenFu.GenFu.SetPropertyValue(Object instance, PropertyInfo property) in C:\james\code\GenFu\src\GenFu\GenFu.cs:line 111
at GenFu.GenFu.New(Object instance) in C:\james\code\GenFu\src\GenFu\GenFu.cs:line 53
at GenFu.GenFu.BuildList(Type type, Int32 itemCount) in C:\james\code\GenFu\src\GenFu\GenFu.cs:line 101
at GenFu.GenFu.ListOf[T](Int32 itemCount) in C:\james\code\GenFu\src\GenFu\GenFu.cs:line 89
----- Inner Stack Trace #2 (Xunit.Sdk.TestClassException) -----
Result Message:
System.AggregateException : One or more errors occurred. (An item with the same key has already been added. Key: System.Nullable
1[System.Int64]) ---- System.ArgumentException : An item with the same key has already been added. Key: System.Nullable
1[System.Int64]The text was updated successfully, but these errors were encountered: