From 9e9598f30a364439919f8ea6a0333471ab2eb4f7 Mon Sep 17 00:00:00 2001 From: Widthdom Date: Sat, 25 Jul 2026 02:21:11 +0900 Subject: [PATCH] Link console capture race fix to #4808 --- changelog.d/unreleased/4800-4808.fixed.md | 17 +++++++++++++++++ changelog.d/unreleased/4800.fixed.md | 16 ---------------- tests/CodeIndex.Tests/ConsoleCaptureTests.cs | 2 +- 3 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 changelog.d/unreleased/4800-4808.fixed.md delete mode 100644 changelog.d/unreleased/4800.fixed.md diff --git a/changelog.d/unreleased/4800-4808.fixed.md b/changelog.d/unreleased/4800-4808.fixed.md new file mode 100644 index 000000000..2b9590b10 --- /dev/null +++ b/changelog.d/unreleased/4800-4808.fixed.md @@ -0,0 +1,17 @@ +--- +category: fixed +issues: + - 4800 + - 4808 +affected: + - tests/CodeIndex.Tests/ConsoleCaptureTests.cs + - TESTING_GUIDE.md +--- + +## English + +- **Console capture restoration assertions no longer race parallel tests (#4800, #4808)** — the timeout regression test now snapshots and verifies `Console.Out` and `Console.Error` while holding the shared console ownership gate, preventing another test from replacing a writer during the assertion. + +## 日本語 + +- **console capture の復元 assertion が並列テストと競合しなくなりました (#4800, #4808)** — timeout 回帰テストは共有 console ownership gate を保持した状態で `Console.Out` と `Console.Error` の snapshot 取得と検証を行うため、assertion 中に別のテストが writer を差し替える競合を防止します。 diff --git a/changelog.d/unreleased/4800.fixed.md b/changelog.d/unreleased/4800.fixed.md deleted file mode 100644 index 9c54679d7..000000000 --- a/changelog.d/unreleased/4800.fixed.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -category: fixed -issues: - - 4800 -affected: - - tests/CodeIndex.Tests/ConsoleCaptureTests.cs - - TESTING_GUIDE.md ---- - -## English - -- **Console capture restoration assertions no longer race parallel tests (#4800)** — the timeout regression test now snapshots and verifies `Console.Out` and `Console.Error` while holding the shared console ownership gate, preventing another test from replacing a writer during the assertion. - -## 日本語 - -- **console capture の復元 assertion が並列テストと競合しなくなりました (#4800)** — timeout 回帰テストは共有 console ownership gate を保持した状態で `Console.Out` と `Console.Error` の snapshot 取得と検証を行うため、assertion 中に別のテストが writer を差し替える競合を防止します。 diff --git a/tests/CodeIndex.Tests/ConsoleCaptureTests.cs b/tests/CodeIndex.Tests/ConsoleCaptureTests.cs index 1d562a6ac..e616f0877 100644 --- a/tests/CodeIndex.Tests/ConsoleCaptureTests.cs +++ b/tests/CodeIndex.Tests/ConsoleCaptureTests.cs @@ -193,7 +193,7 @@ await ConsoleCapture.CaptureAsync( } [Fact] - public async Task CaptureAsync_TimeoutRestoresOnlyAfterCallbackObservesCancellation_Issue4749() + public async Task CaptureAsync_TimeoutRestoresOnlyAfterCallbackObservesCancellation_Issues4749And4808() { TextWriter originalOut; TextWriter originalError;