Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions TESTING_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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`
インメモリ入力中心の、純粋またはほぼ純粋な振る舞いのテスト。
Expand Down
16 changes: 16 additions & 0 deletions changelog.d/unreleased/5063.internal.md
Original file line number Diff line number Diff line change
@@ -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 を廃止しました。
8 changes: 3 additions & 5 deletions tests/CodeIndex.Tests/IndexCommandRunnerUpdateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3795,7 +3795,6 @@ public void Run_UpdateFiles_AuthoritativeCSharpParallelFatalDefersWhileEarlierCo
}
};

var stopwatch = Stopwatch.StartNew();
var (exitCode, json) = RunAndCaptureJson(
[
projectRoot,
Expand All @@ -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"));
Expand Down
Loading