-
Notifications
You must be signed in to change notification settings - Fork 49
Description
In our tests we use WebApplicationFactory from ASP.NET Core testing package to test our controllers which uses startup class to bootstrap the server used during tests. Because we run test fixtures in parallel there can be multiple separate threads running the startup code. This raised an issue where the test setup fails because of concurrency exception when JS engine switcher is being initialized.
The exception is thrown from JsEngineFactoryCollection's Add method where the same factory was added twice. However I did not dig deep enough to be sure if there might be similar issues elsewhere.
I'm not sure if this is something that is even supported, so if this is a feature rather than an bug, feel free to close the issue. We have circumvented the issue by using lock to block multiple threads from running startup initialization concurrently in our tests.