I've tried this with the latest build of statlight and still see the following issue:
When we start our tests running with statlight, the first test class is constructed twice. Then our first asynchronous test method is run twice. The test method does one EnqueueCallback to initialize things and then a second EnqueueCallback to run the core
test. But the initialize callback only runs on one class instance, while the core test callback is run only on the other class instance. Our core test callback assumes the initialize callback has run and so we crash when the core test callback tries to use
resources that weren't set up since the initialize callback didn't run.
Any ideas? I don't understand why the test class is constructed twice, and then the callbacks seem to run arbitrarily on different instances of the class. I don't see this behavior if I run the test directly from visual studio.
We have worked around this in some cases by giving every test assembly a dummy non-async test (named AAATestClass with AAATestMethod to make sure it goes first) which does not mind being spun up twice and has no EnqueueCallbacks. But this is problematic
for when we want to run only one test, and obviously doesn't feel like a good solution.
Thanks for any ideas/help.