Skip to content

Isolate raw JSON envelope limit tests from ambient index state #5270

Description

@Widthdom

Observed failure

While validating #5266 on macOS arm64 (SDK 9.0.301, base origin/main at 1425dfbf815e019afb93fd82702eebee374a9304), the net8.0 full suite failed JsonEnvelopeWrapperTests.RunWrapped_ManyRawJsonItems_ReturnsStructuredEnvelopeError_Issue3779: expected exit 7 (InvalidArgument), actual exit 1 (UsageError), at tests/CodeIndex.Tests/JsonEnvelopeWrapperTests.cs:866.

A repository dogfood index update/recovery was running concurrently. The fixture calls JsonEnvelopeWrapper.RunWrapped("search", ["Needle", "--json-envelope"], ...) without an isolated database/project context. It should reach the raw-item-count limit and validate that error independently of the developer's live index.

After the index writer finished, an isolated rerun using the same compiled assemblies passed on both net8.0 and net9.0. Concurrent index activity versus other full-suite state has not been isolated deterministically yet; this is a test-isolation investigation, not a confirmed production regression.

Reproduction commands

Full suite with a concurrent documented repository index refresh:

dotnet test --no-build --no-restore -m:1 --settings tests/CodeIndex.Tests/CodeIndex.Tests.runsettings --blame-crash --blame-hang --blame-hang-timeout 5m

Focused retry after the writer finishes:

dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --no-build --no-restore -m:1 --filter FullyQualifiedName~RunWrapped_ManyRawJsonItems_ReturnsStructuredEnvelopeError_Issue3779

Requested scope

Establish a deterministic reproduction and isolate the raw-envelope error fixture from ambient database/project state. Audit adjacent raw-envelope limit cases only where setup can naturally be shared. Preserve the item-count cap, structured error metadata, exit-code assertions, and production snapshot safety checks. Validate both target frameworks with an unrelated index writer active.

This is outside #5266's search-alternative fixture change. Related error-report hint interference is already tracked by #5264 and is being worked separately.

Open-issue duplicate checks for the exact test name, envelope tests, and ambient found no existing issue for this fixture.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions