Skip to content

Reuse C# RPC process across CSharpRecipeTest methods#7332

Merged
steve-aom-elliott merged 1 commit intomainfrom
fix/reduce-csharp-test-flakiness
Apr 9, 2026
Merged

Reuse C# RPC process across CSharpRecipeTest methods#7332
steve-aom-elliott merged 1 commit intomainfrom
fix/reduce-csharp-test-flakiness

Conversation

@steve-aom-elliott
Copy link
Copy Markdown
Contributor

Summary

  • CSharpRecipeTest was shutting down and restarting the dotnet RPC process after every test method, paying the full cost of process startup + NuGet restore + JIT warmup each time
  • On slow CI runners this can push individual tests past the 60-second RPC timeout, causing intermittent deleteMethodArgument failures
  • Switch @AfterEach from shutdownCurrent() to resetCurrent() (clears RPC state without killing the process) and add @AfterAll to shut down when the class is done

Test plan

  • CI passes on this PR (the C# test suite itself is the verification)
  • CSharpRecipeTest.deleteMethodArgument no longer times out on slow runners

Each test was shutting down and restarting the dotnet process, paying
the full cost of process startup + NuGet restore + JIT warmup every
time. On slow CI runners this can push individual tests past the
60-second RPC timeout, causing flaky failures.

Switch @AfterEach to resetCurrent() (clears RPC state, keeps process
alive) and add @afterall to shut down the process when the class is
done.
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Apr 9, 2026
@steve-aom-elliott steve-aom-elliott merged commit 1322a65 into main Apr 9, 2026
1 check passed
@steve-aom-elliott steve-aom-elliott deleted the fix/reduce-csharp-test-flakiness branch April 9, 2026 16:56
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant