You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.
I've never had issues with Java implementation of ExtentReports (version 2.4) running Selenium tests in parallel in the past.
But currently I'm running some API tests on C# implementation of ExtentReports in parallel and these tests are very fast, so when I'm calling .Log(...) on ExtentTest, I end up (from time to time) with System.InvalidOperationException (Collection was modified; enumeration operation may not execute.)
Here's part of the stacktrace:
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List1.ForEach(Action1 action)
at AventStack.ExtentReports.Model.Test.UpdateTestStatusRecursive(Test test)
at AventStack.ExtentReports.Model.Test.End()
at AventStack.ExtentReports.Model.Test.<>c.b__73_0(Test x)
at System.Collections.Generic.List1.ForEach(Action1 action)
at AventStack.ExtentReports.Model.Test.EndChildTestsRecursive(Test test)
at AventStack.ExtentReports.Model.Test.End()
at AventStack.ExtentReports.Model.Report.EndTest(Test test)
at AventStack.ExtentReports.Model.Report.b__19_0(Test test)
at System.Collections.Generic.List1.ForEach(Action1 action)
at AventStack.ExtentReports.Model.Report.CollectRunInfo()
at AventStack.ExtentReports.Model.Report.AddLog(Test test, Log log)
at AventStack.ExtentReports.ExtentTest.AddLog(Log evt)
at AventStack.ExtentReports.ExtentTest.Log(Status status, String details, MediaEntityModelProvider provider)
Since it's an error on System.Collections.Generic.List, it could imho be solved in your AbstractStructure.cs file with ConcurrentDictionary instead of List _list, with integer TKey as array index and TValue as array value, since there's no ConcurrentList in C# yet and ConcurrentBag is unordered.
The text was updated successfully, but these errors were encountered:
I'm currently using locks to get rid of this message, but apparently the more tests I have, the slower the run is, since the ForEach takes longer and longer.
I've never had issues with Java implementation of ExtentReports (version 2.4) running Selenium tests in parallel in the past.
But currently I'm running some API tests on C# implementation of ExtentReports in parallel and these tests are very fast, so when I'm calling .Log(...) on ExtentTest, I end up (from time to time) with System.InvalidOperationException (Collection was modified; enumeration operation may not execute.)
Here's part of the stacktrace:
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List
1.ForEach(Action
1 action)at AventStack.ExtentReports.Model.Test.UpdateTestStatusRecursive(Test test)
at AventStack.ExtentReports.Model.Test.End()
at AventStack.ExtentReports.Model.Test.<>c.b__73_0(Test x)
at System.Collections.Generic.List
1.ForEach(Action
1 action)at AventStack.ExtentReports.Model.Test.EndChildTestsRecursive(Test test)
at AventStack.ExtentReports.Model.Test.End()
at AventStack.ExtentReports.Model.Report.EndTest(Test test)
at AventStack.ExtentReports.Model.Report.b__19_0(Test test)
at System.Collections.Generic.List
1.ForEach(Action
1 action)at AventStack.ExtentReports.Model.Report.CollectRunInfo()
at AventStack.ExtentReports.Model.Report.AddLog(Test test, Log log)
at AventStack.ExtentReports.ExtentTest.AddLog(Log evt)
at AventStack.ExtentReports.ExtentTest.Log(Status status, String details, MediaEntityModelProvider provider)
Since it's an error on System.Collections.Generic.List, it could imho be solved in your AbstractStructure.cs file with ConcurrentDictionary instead of List _list, with integer TKey as array index and TValue as array value, since there's no ConcurrentList in C# yet and ConcurrentBag is unordered.
The text was updated successfully, but these errors were encountered: