Skip to content

[pull] master from microsoft:master#90

Merged
pull[bot] merged 2 commits into
cgallred:masterfrom
microsoft:master
May 6, 2026
Merged

[pull] master from microsoft:master#90
pull[bot] merged 2 commits into
cgallred:masterfrom
microsoft:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 6, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

tyrielv added 2 commits May 6, 2026 12:25
The StatusTests WriteWithoutClose and CreateFileWithoutClose tests
intentionally open file handles without closing them, then validate
git status behavior. The handles were created as local variables
inside OpenFileAndWriteWithoutClose/CreateFileWithoutClose with no
reference kept — making them eligible for GC immediately. If the
GC collected the handles before TearDown ran git reset --hard, the
reset would succeed (no lock errors) while the control repo might
still have errors, causing a flaky mismatch.

Fix: return IDisposable from the file-handle-leaking methods, hold
them in using blocks in the test methods. Handles stay alive for
the assertion scope and are deterministically disposed before
TearDown runs, eliminating the GC race. Also add StreamWriter.Flush()
to ensure written data is on disk before returning.

Assisted-by: Claude Opus 4.6
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
…lose

Fix flaky WriteWithoutClose/CreateFileWithoutClose functional tests
@pull pull Bot locked and limited conversation to collaborators May 6, 2026
@pull pull Bot added the ⤵️ pull label May 6, 2026
@pull pull Bot merged commit 59bfc47 into cgallred:master May 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant