diff --git a/TESTING_GUIDE.md b/TESTING_GUIDE.md index d2def1215..f3d978b94 100644 --- a/TESTING_GUIDE.md +++ b/TESTING_GUIDE.md @@ -81,6 +81,7 @@ Use the full suite by default. Use targeted filters only while iterating locally The test project mirrors the production areas closely. Use `docs/test-doc-maintenance-plan.md` before moving oversized suites or adding `Skip =` cases; it tracks the current split sequence, skip classifications, and large-document boundaries. +Candidate-ordered parallel-index recovery tests must prove that the fatal result returns while the earlier contract candidate remains blocked and the parallel workers have not stopped. Assert those synchronization states instead of a narrow wall-clock threshold so the regression remains detectable under full-suite contention. - `ChunkSplitterTests.cs`, `SymbolExtractorTests.cs`, `ReferenceExtractorTests.cs`, `SearchSnippetFormatterTests.cs`, `DbPathResolverTests.cs`, `DbReaderUtilityTests.cs`, `ExcerptRecoveryCommandFormatterTests.cs`, `ConsoleUiTests.cs` Pure or mostly pure behavior tests with in-memory inputs. @@ -1081,6 +1082,7 @@ dotnet test --filter "FullyQualifiedName~GitHelperTests" テストプロジェクトは、本番コードの責務にかなり近い形で分かれています。 巨大 suite を移動する場合や `Skip =` case を追加する場合は、現在の分割順序、skip 分類、巨大ドキュメントの境界を追跡する `docs/test-doc-maintenance-plan.md` を先に確認してください。 +候補順序に基づく parallel index recovery のテストでは、先行する contract 候補が block されたまま、かつ parallel worker が停止する前に fatal result が返ることを検証してください。full-suite の競合下でも回帰を検出できるよう、狭い wall-clock threshold の代わりにこれらの同期状態を assertion にします。 - `ChunkSplitterTests.cs`、`SymbolExtractorTests.cs`、`ReferenceExtractorTests.cs`、`SearchSnippetFormatterTests.cs`、`DbPathResolverTests.cs`、`DbReaderUtilityTests.cs`、`ExcerptRecoveryCommandFormatterTests.cs`、`ConsoleUiTests.cs` インメモリ入力中心の、純粋またはほぼ純粋な振る舞いのテスト。 diff --git a/changelog.d/unreleased/5063.internal.md b/changelog.d/unreleased/5063.internal.md new file mode 100644 index 000000000..1613aa2dd --- /dev/null +++ b/changelog.d/unreleased/5063.internal.md @@ -0,0 +1,16 @@ +--- +category: internal +issues: + - 5063 +affected: + - tests/CodeIndex.Tests/IndexCommandRunnerUpdateTests.cs + - TESTING_GUIDE.md +--- + +## English + +- **Candidate-ordered recovery coverage now uses synchronization state (#5063)** — The parallel update regression test now proves that the fatal path returns while the earlier contract candidate remains blocked, avoiding a narrow wall-clock assertion under full-suite load. + +## 日本語 + +- **候補順序回復のカバレッジを同期状態で検証するようにしました (#5063)** — 並列更新の回帰テストは、先行する contract 候補が block されたまま fatal path が返ることを検証し、full-suite 負荷の影響を受ける狭い wall-clock assertion を廃止しました。 diff --git a/tests/CodeIndex.Tests/IndexCommandRunnerUpdateTests.cs b/tests/CodeIndex.Tests/IndexCommandRunnerUpdateTests.cs index bb3ea38ff..3135c3a4c 100644 --- a/tests/CodeIndex.Tests/IndexCommandRunnerUpdateTests.cs +++ b/tests/CodeIndex.Tests/IndexCommandRunnerUpdateTests.cs @@ -3795,7 +3795,6 @@ public void Run_UpdateFiles_AuthoritativeCSharpParallelFatalDefersWhileEarlierCo } }; - var stopwatch = Stopwatch.StartNew(); var (exitCode, json) = RunAndCaptureJson( [ projectRoot, @@ -3806,13 +3805,12 @@ public void Run_UpdateFiles_AuthoritativeCSharpParallelFatalDefersWhileEarlierCo "--parallelism", "2", ]); - stopwatch.Stop(); Assert.True(candidateWorkerEntered.IsSet); Assert.DoesNotContain("Source00.cs", completedExtractions.Keys); - Assert.True( - stopwatch.Elapsed < TimeSpan.FromSeconds(5), - $"The candidate-ordered serial recovery took {stopwatch.Elapsed}."); + Assert.False( + workersStopped.IsSet, + "The candidate-ordered parallel pipeline stopped before the earlier candidate was released."); Assert.Equal(CommandExitCodes.PartialResult, exitCode); Assert.Equal("partial", json.GetProperty("status").GetString()); Assert.Equal(sourceZeroChecksum, ReadIndexedChecksum(dbPath, "Source00.cs"));