{"action":"created","issue":{"url":"https://api.github.com/repos/anshooarora/extentreports-csharp/issues/75","repository_url":"https://api.github.com/repos/anshooarora/extentreports-csharp","labels_url":"https://api.github.com/repos/anshooarora/extentreports-csharp/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/anshooarora/extentreports-csharp/issues/75/comments","events_url":"https://api.github.com/repos/anshooarora/extentreports-csharp/issues/75/events","html_url":"https://github.com/anshooarora/extentreports-csharp/issues/75","id":244311503,"number":75,"title":"Concurrent logging causes \"Collection was modified\" error","user":{"login":"mhgames","id":8024866,"avatar_url":"https://avatars0.githubusercontent.com/u/8024866?v=4","gravatar_id":"","url":"https://api.github.com/users/mhgames","html_url":"https://github.com/mhgames","followers_url":"https://api.github.com/users/mhgames/followers","following_url":"https://api.github.com/users/mhgames/following{/other_user}","gists_url":"https://api.github.com/users/mhgames/gists{/gist_id}","starred_url":"https://api.github.com/users/mhgames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhgames/subscriptions","organizations_url":"https://api.github.com/users/mhgames/orgs","repos_url":"https://api.github.com/users/mhgames/repos","events_url":"https://api.github.com/users/mhgames/events{/privacy}","received_events_url":"https://api.github.com/users/mhgames/received_events","type":"User","site_admin":false},"labels":[{"id":411353740,"url":"https://api.github.com/repos/anshooarora/extentreports-csharp/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-20T10:12:40Z","updated_at":"2017-08-10T17:21:22Z","closed_at":null,"body":"I've never had issues with Java implementation of ExtentReports (version 2.4) running Selenium tests in parallel in the past.\r\n\r\nBut 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.**)\r\n\r\nHere's part of the stacktrace:\r\n   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)\r\n   at System.Collections.Generic.List`1.ForEach(Action`1 action)\r\n   at AventStack.ExtentReports.Model.Test.UpdateTestStatusRecursive(Test test)\r\n   at AventStack.ExtentReports.Model.Test.End()\r\n   at AventStack.ExtentReports.Model.Test.<>c.<EndChildTestsRecursive>b__73_0(Test x)\r\n   at System.Collections.Generic.List`1.ForEach(Action`1 action)\r\n   at AventStack.ExtentReports.Model.Test.EndChildTestsRecursive(Test test)\r\n   at AventStack.ExtentReports.Model.Test.End()\r\n   at AventStack.ExtentReports.Model.Report.EndTest(Test test)\r\n   at AventStack.ExtentReports.Model.Report.<CollectRunInfo>b__19_0(Test test)\r\n   at System.Collections.Generic.List`1.ForEach(Action`1 action)\r\n   at AventStack.ExtentReports.Model.Report.CollectRunInfo()\r\n   at AventStack.ExtentReports.Model.Report.AddLog(Test test, Log log)\r\n   at AventStack.ExtentReports.ExtentTest.AddLog(Log evt)\r\n   at AventStack.ExtentReports.ExtentTest.Log(Status status, String details, MediaEntityModelProvider provider)\r\n\r\nSince it's an error on System.Collections.Generic.List, it could imho be solved in your AbstractStructure.cs file with ConcurrentDictionary instead of List<T> _list, with integer TKey as array index and TValue as array value, since there's no ConcurrentList in C# yet and ConcurrentBag is unordered."},"comment":{"url":"https://api.github.com/repos/anshooarora/extentreports-csharp/issues/comments/321617623","html_url":"https://github.com/anshooarora/extentreports-csharp/issues/75#issuecomment-321617623","issue_url":"https://api.github.com/repos/anshooarora/extentreports-csharp/issues/75","id":321617623,"user":{"login":"anshooarora","id":4107384,"avatar_url":"https://avatars2.githubusercontent.com/u/4107384?v=4","gravatar_id":"","url":"https://api.github.com/users/anshooarora","html_url":"https://github.com/anshooarora","followers_url":"https://api.github.com/users/anshooarora/followers","following_url":"https://api.github.com/users/anshooarora/following{/other_user}","gists_url":"https://api.github.com/users/anshooarora/gists{/gist_id}","starred_url":"https://api.github.com/users/anshooarora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anshooarora/subscriptions","organizations_url":"https://api.github.com/users/anshooarora/orgs","repos_url":"https://api.github.com/users/anshooarora/repos","events_url":"https://api.github.com/users/anshooarora/events{/privacy}","received_events_url":"https://api.github.com/users/anshooarora/received_events","type":"User","site_admin":false},"created_at":"2017-08-10T17:21:22Z","updated_at":"2017-08-10T17:21:22Z","body":"Can you please try with the attached dll.  Any luck?\r\n\r\n[ExtentReports.zip](https://github.com/anshooarora/extentreports-csharp/files/1215781/ExtentReports.zip)\r\n"}}
{"actor":{"display_login":"anshooarora"}}