Closed jaslawinMs closed 1 year ago
can we add a test to verify multi thread scenarios?
Not really. Not a deterministic test. It shows up only probabilistically unless we were to use some concurrency test system that allows us to control the interleaving.
I understand that multi-threading issues are difficult to reproduce, but we could try to reproduce, maybe using some test benchmark like https://github.com/timcassell/ProtoBenchmarkHelpers ?
According to #87:
this can be reproduced when running unit-tests that use the model parser from the Visual Studio unit-test runner, which will execute the tests on multiple threads by default.
So one option may be to change the ci action to execute tests in parallel.
@jaslawinMs can you share more details about your tests? Do you share any parser instances across threads, maybe using static variables? or is the parser instantiated on each test method?
tests are executed in parallel (xunit). The parser object is created for each test (a field in a test class). I also used static field and ThreadStatic attribute but it had no effect
version: 1.0.4-preview
When multiple threads are parsing models sometimes this exception is thrown:
Message:
System.IndexOutOfRangeException : Index was outside the bounds of the array.
Stack Trace: