Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NUnit tests being aborted randomly (Involves ServiceStack & RavenDB)

NUnit tests being aborted randomly (Involves ServiceStack & RavenDB)

We have a project where we use ServiceStack and RavenDB. Testing is done using NUnit.

When running the tests individually everything works fine. When running more than one test a few will do their thing (pass/fail) but very often one of the tests will be aborted and all subsequent tests will not be run. Which test aborts is seemingly random. The more tests that are being run the higher the chance that one will be aborted. The test that gets aborted does seem to be able to run through all its actions though seeing from the test log.

Unfortunately I'm not able to give more info besides the following files which show the way our tests are set up.

  • IntegrationBaseTest.cs (Base test class)
  • GlobalSetupFixture.cs
  • AccountServiceTests.cs (Example file with tests)
  • test log (Log of aborted test, in this case DeleteAccount_DeletesAccount)
  • Result view of running all tests in AccountServiceTests.cs.
    Which test gets aborted is completely random.
    Failing test view

Does anyone have any idea of what I could try to fix this? :)

like image 889
Jeroen Pelgrims Avatar asked Feb 25 '26 02:02

Jeroen Pelgrims


1 Answers

It turned out that when disabling the logging the tests ran normally without aborting.
I'm not sure what caused them to abort but I think it might be because the jetbrains taskrunner was running out of memory because of all the logs.

like image 187
Jeroen Pelgrims Avatar answered Mar 03 '26 19:03

Jeroen Pelgrims



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!