efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Cosmos: improve testing speed

Open roji opened this issue 1 year ago • 3 comments

It's likely that we have certain tests which take a very long time (possibly anything needing to create databases/containers), but the majority of tests seem to run very fast (e.g. all query tests combined are a small fraction of the total assembly running time). We should find out which tests are the worst offenders and see if there's something we can do about them.

Also, look into enabling test parallelization (this is currently disabled via [assembly: CollectionBehavior(DisableTestParallelization = true)]). As above, it's likely we have some tests which cannot be parallelized, but we do it for those tests only rather than disabling for the entire assembly.

roji avatar Jun 13 '24 11:06 roji

Image

roji avatar Jun 25 '24 08:06 roji

Here's a test run where tests are grouped by running time. tl;dr aside from Should_throw_if_specified_connection_mode_is_wrong which times out after 10 minutes (possibly related to my VM setup somehow?), OptimisticConcurrencyCosmosTest is the main culprit with 3 minutes, 24 seconds (over 50% of the total test running time if we remove Should_throw_if_specified_connection_mode_is_wrong).

Image

roji avatar Jun 25 '24 08:06 roji

@roji I noticed OptimisticConcurrencyCosmosTest as well.

ajcvickers avatar Jun 26 '24 09:06 ajcvickers