specflowspecrun

Specrun - delay of threads


I have a tests written in c#, I am using SpecRun version 1.5.2.

Part of my Default.srprofile looks as follows:

<Execution stopAfterFailures="20" testThreadCount="5" testSchedulingMode="Sequential" retryFor="Failing" retryCount="3" />

There is a bunch of tests that are using some data from the db, so the tests are creating that data first. Unfortunately when 5 threads are running parallel, I am occasionally getting a sql deadlock error which is fine, as those threads try to write data in same time.

Is there any chance to add a delay of thread execution? Something to say than threads should start within 5s seconds interval or something similar?


Solution

  • There is no option for a delayed start and I wouldn't go with this idea. It is only a quick fix. You will get this error again when later test are executed simultaneous.

    2 options to fix your problem come to my mind:


    Full Disclosure: I am one of the developers of SpecFlow and SpecFlow+.