[ogar-adapter-csharp] isolate dotnet CLI home per test — fix flaky NuGet-migration shm race#181
Open
AdaWorldAPI wants to merge 1 commit into
Open
[ogar-adapter-csharp] isolate dotnet CLI home per test — fix flaky NuGet-migration shm race#181AdaWorldAPI wants to merge 1 commit into
AdaWorldAPI wants to merge 1 commit into
Conversation
…Get-migration shm race The C# parity tests shell out to `dotnet build`/`dotnet run` but shared the default dotnet home (`~/.dotnet`, or `/tmp/.dotnet` when HOME is unset). Its first-run NuGet-migration step opens a named session mutex under `.../shm/session<N>`; two concurrent `dotnet` processes (parallel test binaries, or parallel CI jobs on one runner) race on the same path and one fails with `mkdir(...) == -1; errno == EEXIST` in NuGet.Common.Migrations.MigrationRunner — an intermittent hard failure with nothing to do with the code under test (observed red on OGAR #179 while main was green on the same commit + same test). Fix: point HOME + DOTNET_CLI_HOME + NUGET_PACKAGES at a per-test unique temp dir (sibling of the existing per-test project dir), so the shm/session dirs never collide. `dotnet()` now takes a home path; both tests create and clean their own home; the availability probe uses a throwaway home. Test-only, no product change; compiles clean (`cargo test -p ogar-adapter-csharp --no-run`).
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_7f8d2532-12ba-4a82-8bab-b2c018c10bf4) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Was
Die C#-Parity-Tests (
ogar-adapter-csharp, aus #177) rufendotnet build/dotnet runauf, teilten aber das Default-dotnet-Home (~/.dotnet, bzw./tmp/.dotnetwenn HOME ungesetzt). Dessen First-Run-NuGet-Migration öffnet einen Named-Session-Mutex unter.../shm/session<N>; zwei nebenläufigedotnet-Prozesse (parallele Test-Binaries oder parallele CI-Jobs auf einem Runner) rennen auf denselben Pfad und einer failt mitmkdir(...) == -1; errno == EEXISTinNuGet.Common.Migrations.MigrationRunner.Das ist ein intermittierender Infra-Flake, kein Code-Defekt — beobachtet als rot auf OGAR #179, während main auf demselben Commit + demselben Test grün war (der Mint in #179 berührt
ogar-adapter-csharpnicht).Fix
HOME+DOTNET_CLI_HOME+NUGET_PACKAGESzeigen jetzt auf ein per-Test eindeutiges Temp-Verzeichnis (Sibling des bereits vorhandenen per-Test-Projekt-Dirs), sodass die shm/session-Dirs nie kollidieren.dotnet()nimmt einen home-Pfad; beide Tests legen ihr eigenes home an und räumen es auf; die Availability-Probe nutzt ein Wegwerf-home.Scope
Nur Test-Infra (
tests/parity.rs), keine Produkt-/Emitter-Änderung. Kompiliert clean (cargo test -p ogar-adapter-csharp --no-run→ Finished). Die eigentliche Build+Run-Parität kann ich im Sandbox nicht ausführen (kein net8.0-SDK), aber die Isolations-Logik ist die Standard-Lösung für genau diesen dotnet-shm-Race; CI mit SDK verifiziert.🤖 Generated with Claude Code
https://claude.ai/code/session_01Cg8DSUz1U4AvKqXiy9Xx2f