microsoft / coyote

Coyote is a library and tool for testing concurrent C# code and deterministically reproducing bugs.
https://microsoft.github.io/coyote/
Other
1.48k stars 76 forks source link

race in updating coverage report #464

Open pdeligia opened 1 year ago

pdeligia commented 1 year ago

Reported internally (must be a zombie thread updating coverage after iteration finishes). We need to make the code more defensive.

Error: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.Collections.Generic.HashSet`1.Enumerator.MoveNext()
   at System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1 other)
   at Microsoft.Coyote.Coverage.CoverageInfo.Merge(CoverageInfo coverageInfo)
   at Microsoft.Coyote.Actors.Coverage.ActorCoverageInfo.Merge(CoverageInfo coverageInfo)
   at Microsoft.Coyote.SystematicTesting.TestingEngine.GatherTestingStatistics(CoyoteRuntime runtime)
   at Microsoft.Coyote.SystematicTesting.TestingEngine.RunNextIteration(TestMethodInfo methodInfo, UInt32 iteration)
   at Microsoft.Coyote.SystematicTesting.TestingEngine.<>c__DisplayClass41_0.<CreateTestingTask>b__0()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Coyote.SystematicTesting.TestingEngine.<>c__DisplayClass41_0.<CreateTestingTask>b__0()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Coyote.SystematicTesting.TestingEngine.Run()
   at Microsoft.Azure.Giza.Meta.Test.ModelChecker.GizaMMCoyoteTest.GizaCoyoteBasedMMTest()