Specflow: Specrun CLI: Tests are being discovered, but wait long time before starting even with valid license

Created on 22 May 2019  Â·  17Comments  Â·  Source: SpecFlowOSS/SpecFlow

SpecFlow Version:

  • [x] 3.0
  • [ ] 2.4
  • [ ] 2.3
  • [ ] 2.2
  • [ ] 2.1
  • [ ] 2.0
  • [ ] 1.9

Used Test Runner

  • [x] SpecFlow+Runner
  • [ ] MSTest
  • [ ] NUnit
  • [ ] Xunit

Version number: 3.0.337

Project Format of the SpecFlow project

  • [ ] Classic project format using packages.config
  • [x] Classis project format using <PackageReference> tags
  • [ ] Sdk-style project format

.feature.cs files are generated using

  • [x] SpecFlow.Tools.MsBuild.Generation NuGet package
  • [ ] SpecFlowSingleFileGenerator custom tool

Visual Studio Version

  • [ ] VS 2019
  • [x] VS 2017
  • [ ] VS 2015

Enable SpecFlowSingleFileGenerator Custom Tool option in Visual Studio extension settings

  • [ ] Enabled
  • [x] Disabled

Are the latest Visual Studio updates installed?

  • [x] Yes
  • [ ] No

.NET Framework:

  • [x] >= .NET 4.5
  • [ ] before .NET 4.5
  • [ ] .NET Core 2.0
  • [ ] .NET Core 2.1
  • [ ] .NET Core 2.2
  • [ ] .NET Core 3.0

Test Execution Method:

  • [ ] Visual Studio Test Explorer
  • [ ] TFS/VSTS/Azure DevOps – Task – PLEASE SPECIFY THE NAME OF THE TASK
  • [x] Command line – "{path to specrun.exe in bin folder}" run {our profile}.srprofile --baseFolder "{path to project folder}" --outputFolder "{path to a file share}"

Section in app.config or content of specflow.json

{it's empty}

Repro Project

Unfortunately it's internal, so we cannot include it

Issue Description

We just migrated from SpecFlow 2.4 and SpecRun 1.8 to SpecFlow 3+ and SpecRun 3+. Before when we would run our test from the command line, the tests would be discovered and then ran immediately on the desired number of threads. We upgraded the versioning and fixed all of the breaking changes, then tested everything successfully from within Visual Studio 2017 (Enterprise, though I imagine that shouldn't make a difference). Now we are trying to run the tests via the command line (command included above) and for some reason the tests ARE discovered immediately, but won't run for about 30 seconds to a minute. The trace will be output to the console with "(0/{# of tests}) completed" and the lane for each thread displayed, but the first test finally gets cued after about 30-60 seconds.

Attempts at troubleshooting have been to retry running the tests in VS (which was successful) and unregistering then re-registering the license to ensure that it is being respected (successfully executed, but didn't fix our issue). We then ran the command again with Task Manager open to see if something was consuming too many resources to find that the SpecRun.exe process was consuming no resources until that 30-60 seconds had passed.

We have no clue how else to tackle this. Is there anything that we could be failing to set to ensure the same speed provided by VS is found using the CLI?

Steps to Reproduce

  1. Ensure you have your license set up
  2. Build the project
  3. Call the above CLI command with valid parameters
  4. See the command indicate that the tests were discovered and have it start the trace, but with no progress for 30-60 seconds
Bug SpecFlow+ hard medium

All 17 comments

@btvanhooser There should be a logfile, normally named specrun.log. Could you send this to [email protected]?
Is the baseFolder parameter really empty or did you removed it?

I get that right now, and no I used angle brackets to detail what was in each double quotes and forgot that it was markup... so it got removed..

Updated the original post with "{}" so you can see the intended info

Hey @SabotageAndi, I think we might actually have a worse problem then... it doesn't seem like that file does get generated for us. The Report gets generated in that output folder, but not in the log file.

Any thoughts as to why that'd be off :/ Hadn't noticed that since we only distribute the report

As a follow up, it seems that the log file is generated when running the tests from within Visual Studio, but not from the command line. I'm assuming that is because the adapter is doing something that we aren't?

Scratch that, I found the "--log" parameter and generated the file this time. I emailed it now with a link to this post.

Thanks for the logfile. It looks like the child-process dies for some reason.
Sadly the log says nothing why. I will adjust the logging in that part. When we have a new version on NuGet (should be next week), I will inform you.

Awesome, thank you!

@SabotageAndi Not to bug, but any update on the additional logging?

Sorry, the fix where I added the logging is taking longer as anticipated. I hope to finish it this week.

Understandable :) Thank you for the update

Version with the additional logging was released.

Updated to the latest packages and re-ran the tests. I'll send the log to the same email as before, though I do see that the section where the child process is being waited for still seems to only output that it failed to connect.

Hey, any update on this?

It looks like, making the connection to the out of process executors is talking a lot of time for you.
Could you try to lower your test thread count (looks like it is 32) and see if it changes something?

Hey @SabotageAndi , sorry for the delay on my part. We were working through a number of issues using SpecFlow+, so we elected to switch to using SpecFlow+NUnit instead. I believe our team is at a consensus on this, so we are good to close this ticket out. We are seeing a small issue, but it appears that you already have an open issue for the exact scenario we are seeing (https://github.com/techtalk/SpecFlow/issues/989). Once that is resolved, I believe we will be all set on our side. Thank you for the support that you provided on this.

I am reopening the issue, because I still want to have a look at it.

Was this page helpful?
0 / 5 - 0 ratings