Test host process crash when running multiple tests

Hi,

I am developing my custom rhino plugin and am setting up the automated tests for the various features. I am encountering a problem with the testing environment where I can run smoothly each test one by one without failure, I can even run some tests grouped at once but if I group too many of them or try to run all tests the process freezes at some point and crashes with the enigmatic message “[Error] The active test run was aborted. Reason: Test host process crashed” …

  • Any idea on how to solve this ?
  • Could this be related to RhinoDoc.ActiveDoc usage on several tests ? I was also wondering if there is a safe way to clean the ActiveDoc between tests when running multiple tests, since some of them are testing the serialisation of my plugin (through Read/WriteDocument) I kind of need to go with ActiveDoc save/Open right ?

I am using Rhino.Testing package and correctly (hopefully) using RhinoSetupFixture and RhinoTestFixture.

Thanks for your help

I’m having the same problem. Could be any roblem of the antivirus/firewall?

I’m having the same problem on my CI agent so I doubt that it could be related to firewall.

I was able to narrow it down to a simple usecase with 2 tests, if I run each test separately they execute fine but if I try to tell VS or dotnet test to run both of them the process crashes.
Here are the tests :

[Test]
public void MyFirstTest()
{
    // do stuff
    string file = "myoutput.3dm";
    // test save
    Rhino.RhinoDoc.ActiveDoc.SaveAs(file);
    // some tests
    // test reload with mycustomplugin ReadDocument being called (that's what I want to test)
    Rhino.RhinoDoc.Open(file, out bool _);
    // some tests
}

[Test]
public void MySecondTest()
{
    //do stuff and load files using File3dm.Read
    // usually crashes after some files have been read but not all, if I read only file there is no crash ...
}