Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Race condition when running multiple tests #4

Open
NearHuscarl opened this issue Jul 21, 2021 · 1 comment
Open

Race condition when running multiple tests #4

NearHuscarl opened this issue Jul 21, 2021 · 1 comment

Comments

@NearHuscarl
Copy link

I'm writing some test cases for this library before extending it for my internal usage. Right now if you try to run multiple tests, the tests are all failed except one with the error message like below

Member ** is declared in another module and needs to be imported

**: Usually one of these types.

However, they all pass if executed individually. The reason (I believe) is because the WeaverTypes class is static so the TypeReferences are imported from multiple assemblies when running

weavingTask.ExecuteTestRun("AssemblyToTestxX.dll")

In multiple test cases. I implemented a fix by making WeaverTypes non-static and instantiate it as a member of ModuleWeaver and reference it from there instead of globally. If you decide to write unit tests some day, be aware of that pitfall in your code.

@PascalEschbach
Copy link
Owner

Hey there, it seems you already got a fix at hand. If you dont mind, feel free to do a pull request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants