Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flaky InvalidOperationException when running SpecFlow tests in parallel #433

Closed
1 of 3 tasks
delatrie opened this issue Nov 22, 2023 · 0 comments · Fixed by #414
Closed
1 of 3 tasks

Flaky InvalidOperationException when running SpecFlow tests in parallel #433

delatrie opened this issue Nov 22, 2023 · 0 comments · Fixed by #414
Assignees
Labels

Comments

@delatrie
Copy link
Contributor

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Error sometimes is thrown when running SpecFlow tests in a multithreaded environment:

Error Message:
   System.InvalidOperationException : Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.
TearDown : System.InvalidOperationException : No test context is active.
  Stack Trace:
     at System.Collections.Generic.HashSet`1.AddIfNotPresent(T value)
   at System.Collections.Generic.HashSet`1.Add(T item)
   at Allure.SpecFlowPlugin.SelectiveRun.SelectiveRunTestRunner.OnScenarioInitialize(ScenarioInfo scenarioInfo) in /home/runner/work/allure-csharp/allure-csharp/Allure.SpecFlowPlugin/SelectiveRun/SelectiveRunTestRunner.cs:line [70](https://github.com/allure-framework/allure-csharp/actions/runs/6954697067/job/18922010751?pr=414#step:6:71)
   at Allure.Features.TestData.InvalidStepsFeature.ScenarioInitialize(ScenarioInfo scenarioInfo)
   at Allure.Features.TestData.InvalidStepsFeature.AllStepsAreInvalid() in /home/runner/work/allure-csharp/allure-csharp/Allure.Features/TestData/Invalid Steps.feature:line 4
--TearDown
   at Allure.Net.Commons.AllureContext.get_CurrentTest() in /home/runner/work/allure-csharp/allure-csharp/Allure.Net.Commons/AllureContext.cs:line 146
   at Allure.Net.Commons.AllureLifecycle.UpdateTestCase(Action`1 update) in /home/runner/work/allure-csharp/allure-csharp/Allure.Net.Commons/AllureLifecycle.cs:line 413
   at Allure.Net.Commons.AllureLifecycle.StopTestCase() in /home/runner/work/allure-csharp/allure-csharp/Allure.Net.Commons/AllureLifecycle.cs:line 445
   at Allure.SpecFlowPlugin.AllureBindings.FirstAfterScenario() in /home/runner/work/allure-csharp/allure-csharp/Allure.SpecFlowPlugin/AllureBindings.cs:line 49
   at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireEvents(HookType hookType)
   at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireScenarioEvents(HookType bindingEvent)
   at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnScenarioEnd()
   at TechTalk.SpecFlow.TestRunner.OnScenarioEnd()
   at Allure.SpecFlowPlugin.SelectiveRun.SelectiveRunTestRunner.OnScenarioEnd() in /home/runner/work/allure-csharp/allure-csharp/Allure.SpecFlowPlugin/SelectiveRun/SelectiveRunTestRunner.cs:line 58
   at Allure.Features.TestData.InvalidStepsFeature.TestTearDown()

Please tell us about your environment:

  • Allure version: 2.1.0
  • Test framework: testng@6.8
  • Allure adaptor: allure-testng@2.0-BETA8
  • Generate report using: allure-maven@2.18

Other information

Introduced by #392.

@delatrie delatrie added the bug label Nov 22, 2023
@delatrie delatrie self-assigned this Nov 22, 2023
delatrie added a commit that referenced this issue Nov 22, 2023
@delatrie delatrie mentioned this issue Nov 22, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant