SpecFlowOSS / SpecFlow

#1 .NET BDD Framework. SpecFlow automates your testing & works with your existing code. Find Bugs before they happen. Behavior Driven Development helps developers, testers, and business representatives to get a better understanding of their collaboration
https://www.specflow.org/
Other
2.22k stars 751 forks source link

The previous ScenarioContext was already disposed #2751

Open omercanxx opened 1 month ago

omercanxx commented 1 month ago

SpecFlow Version

3.9.52

Which test runner are you using?

xUnit

Test Runner Version Number

2.4.3

.NET Implementation

.NET 6.0

Project Format of the SpecFlow project

Classic project format using <PackageReference> tags

.feature.cs files are generated using

SpecFlow.Tools.MsBuild.Generation NuGet package

Test Execution Method

Visual Studio Test Explorer

SpecFlow Section in app.config or content of specflow.json

No response

Issue Description

Hello,

I've encountered an issue with SpecFlow tests that intermittently fail in our CI pipeline. This problem seems to be related to the ScenarioContext being disposed unexpectedly during test execution. Here are the details:

In our project, we have approximately 1500 tests running on a CI pipeline. While these tests pass consistently when run locally, they intermittently fail in the pipeline environment. Upon investigation, I noticed the following error message in the logs:

The previous ScenarioContext was already disposed

Steps to Reproduce

I dont know how can reproduce the steps. It works on my machine 😅

Link to Repro Project

No response