Skip to content

Commit 05e881c

Browse files
committed
Pin import cancellation console isolation (#4650)
1 parent b60bcdf commit 05e881c

3 files changed

Lines changed: 30 additions & 2 deletions

File tree

TESTING_GUIDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ Use the inventory below before adding or moving a test class:
525525
- SQLite connection-string and command-policy tests are parallel-safe when every in-memory connection and command is instance-owned and disposed; referencing `Microsoft.Data.Sqlite` alone is not a reason to join the SQLite-sensitive collection.
526526
- Cross-platform path matrices can run in parallel when cache seeding is guarded by `PathCasingTestLock` and every filesystem/git fixture owns a unique temporary workspace.
527527
- Exception-formatting contract tests should guard their shared console helper with `TestConsoleLock` and remain parallelizable; their in-memory SQLite retry probes do not mutate the process pool.
528-
- Split pure pre-cancelled import and bounded-stream checks from import-replacement fixtures that mutate test-only hooks. Keep the pre-cancelled import fixture in the console-sensitive collection because empty stderr is part of its contract, while the bounded-stream fixture remains parallel-safe and only the hook-owning class needs SQLite-sensitive serialization.
528+
- Split pure pre-cancelled import and bounded-stream checks from import-replacement fixtures that mutate test-only hooks. Keep the pre-cancelled import fixture in the console-sensitive collection because empty stderr is part of its contract, and pin that assignment with a reflection contract so it cannot drift on either target framework. The bounded-stream fixture remains parallel-safe, while only the hook-owning class needs SQLite-sensitive serialization.
529529
- Release workflow and package-normalizer tests can run outside the SQLite-sensitive collection: xUnit keeps methods in their single class sequential, so its two scoped durability-hook probes cannot overlap each other.
530530
- Database-diff fixtures own independent left/right projects, lock console capture, and keep their sole row-budget override within the same sequential xUnit class; they do not require process-wide SQLite serialization.
531531
- Keep `SuggestionStore` environment-boundary and configured-pruning cases in their small non-parallel fixture; hashing, deduplication, archive, and ordinary persistence cases own isolated directories and should remain parallelizable.
@@ -1230,7 +1230,7 @@ dotnet test --filter "FullyQualifiedName~GitHelperTests"
12301230
- SQLite connection-string / command-policy test は、各 in-memory connection と command を test instance が所有して dispose する限り parallel-safe である。`Microsoft.Data.Sqlite` を参照するだけでは SQLite-sensitive collection に入れる理由にならない。
12311231
- cross-platform path matrix は、cache seed を `PathCasingTestLock` で保護し、各 filesystem / git fixture が一意な temporary workspace を所有する限り parallel 実行できる。
12321232
- exception-formatting contract test は共有 console helper を `TestConsoleLock` で保護して parallel 実行可能に保つ。in-memory SQLite retry probe は process pool を変更しない。
1233-
- pure な事前 cancellation import / bounded-stream check は test-only hook を変更する import replacement fixture から分離する。空の stderr が契約の一部であるため、事前 cancellation import fixture は console-sensitive collection に保ち、bounded-stream fixture は parallel-safe なままとして、SQLite-sensitive な直列化は hook を所有する class だけに限定する。
1233+
- pure な事前 cancellation import / bounded-stream check は test-only hook を変更する import replacement fixture から分離する。空の stderr が契約の一部であるため、事前 cancellation import fixture は console-sensitive collection に保ち、どちらの target framework でもこの割当てが drift しないよう reflection contract で固定する。bounded-stream fixture は parallel-safe なままとして、SQLite-sensitive な直列化は hook を所有する class だけに限定する。
12341234
- release workflow / package-normalizer test は SQLite-sensitive collection の外で実行できる。xUnit は単一 class 内の method を直列に保つため、scope された2件の durability-hook probe は互いに重ならない。
12351235
- database diff fixture は独立した left / right project を所有し、console capture を lock し、唯一の row-budget override を同じ xUnit class の直列実行内に閉じるため、process-wide な SQLite 直列化は不要である。
12361236
- `SuggestionStore` の environment boundary / configured pruning case は小さな non-parallel fixture に隔離する。hash、deduplication、archive、通常の persistence case は独立 directory を所有し、parallel 実行可能に保つ。
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
category: fixed
3+
issues:
4+
- 4650
5+
affected:
6+
- tests/CodeIndex.Tests/ConsoleCaptureTests.cs
7+
- tests/CodeIndex.Tests/ExportImportCommandRunnerIssue3818Tests.cs
8+
- TESTING_GUIDE.md
9+
---
10+
11+
## English
12+
13+
- **Full-suite request-id diagnostics no longer leak into import cancellation stderr (#4650)** — a cross-framework regression contract now pins the import cancellation fixture to the non-parallel console-sensitive collection.
14+
15+
## 日本語
16+
17+
- **full suite の request-id 診断が import cancellation の stderr に漏れ込まなくなりました (#4650)** — framework 共通の regression contract により、import cancellation fixture を non-parallel な console-sensitive collection に固定します。

tests/CodeIndex.Tests/ConsoleCaptureTests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ namespace CodeIndex.Tests;
33
[Collection("Console sensitive")]
44
public class ConsoleCaptureTests
55
{
6+
[Fact]
7+
public void ImportCancellationFixture_UsesConsoleSensitiveCollection_Issue4650()
8+
{
9+
var attribute = Assert.Single(
10+
typeof(ExportImportCommandRunnerCancellationTests).CustomAttributes,
11+
static candidate => candidate.AttributeType == typeof(CollectionAttribute));
12+
var collectionName = Assert.Single(attribute.ConstructorArguments);
13+
14+
Assert.Equal("Console sensitive", collectionName.Value);
15+
}
16+
617
[Fact]
718
public void CaptureError_RestoresConsoleError_WhenActionThrows()
819
{

0 commit comments

Comments
 (0)