SpecFlow icon indicating copy to clipboard operation
SpecFlow copied to clipboard

Large number of feature files hangs the build with no indication of activity

Open sferguson12 opened this issue 4 years ago • 9 comments

When running SpecFlow scenarios in Visual Studio 2019, using a project with a large number of tests (900+ in our case), the build process appears to hang for a long time due to a significant number of file changes triggered by regenerating the code-behind files at build time. We've observed times of 10-20 minutes with no activity logged in the build output or the SpecFlow trace output, after which the requested scenarios run normally.

Please let me know if I can provide any further diagnostic information. I created this issue by request from Andreas Willich on this forum thread.

sferguson12 avatar Aug 31 '20 15:08 sferguson12

Did the latest version help anything?

Could you also add the information from the issue template here, so that we don't have to look into multiple locations for the information. Thanks!

SabotageAndi avatar Sep 04 '20 14:09 SabotageAndi

How many feature files do you have and how evenly are the scenarios distributed between them.

SabotageAndi avatar Sep 04 '20 14:09 SabotageAndi

SpecFlow Version: 3.3 Used Test Runner: Xunit 2.4.1 Project Format: Classic format using both packages.config and <PackageReference> tags (the solution has 160+ total projects of varying ages) .feature.cs file generated using: SpecFlow.Tools.MsBuild.Generation NuGet package Visual Studio Version: VS 2019 Enable SpecFlowSingleFileGenerator Custom Tool: Disabled Latest Visual Studio updates installed: Yes .NET Framework: Both >= .NET 4.5 and .NET Standard Test Execution Method: Visual Studio Test Explorer

sferguson12 avatar Sep 07 '20 03:09 sferguson12

Updating to SpecFlow 3.4.3 did not change the behavior.

sferguson12 avatar Sep 07 '20 03:09 sferguson12

We have about 1200 total feature files in our solution, almost 900 of which are in one project that contains reusable step files referenced by many other projects. (I'm advocating we refactor the step files into a separate project/dll to break this apart.) The tests are somewhat unevenly distributed. Most of our feature files have < 10 scenarios, because editing them starts to get sluggish beyond that point. A few at the high end may have 20 or more scenarios while a larger group of smaller ones have 2-5. Probably 10% of them use Scenario Outlines with anywhere from 5 to 20 examples defined.

sferguson12 avatar Sep 09 '20 00:09 sferguson12

We just finished a tool to generate big projects automatically. I will try it next week to create a similar-sized project and see if I can reproduce this performance behavior at compile time.

SabotageAndi avatar Sep 10 '20 12:09 SabotageAndi

@SabotageAndi is there any update on this issue ?, this still open since 2020.

vuthienan178 avatar Feb 17 '23 06:02 vuthienan178

@SabotageAndi Are there any updates ? I am facing this issue still. Specflow Version: 3.9.74

Kishan1892 avatar Apr 03 '23 16:04 Kishan1892

Sorry @Kishan1892, but I left SpecFlow and Tricentis 2 months ago. I don't work on SpecFlow anymore. I can't help you here.

SabotageAndi avatar Apr 04 '23 07:04 SabotageAndi