Skip to content

Isolate search-alternative tests from the live repository index #5266

Description

@Widthdom

Observed failure

While validating #5260 on macOS arm64, QueryCommandRunnerSearchIssue4906Tests.RunSearch_RegexJsonReturnsTypedShellSafeFindAlternative_Issue4906 failed on net8.0 and net9.0 with expected exit 1, actual exit 3. An isolated rerun reproduced the failure while the repository's normal dogfood index update was active.

The fixture supplies --lang cs but no isolated --db. Language resolution consults the ambient repository database before the unsupported search --regex option is rejected. During index writes, the artifact-preserving query snapshot can return query_only_wal_changed instead of the expected usage error. The snapshot safety rejection itself is expected; the test should not depend on the developer's live index.

Observed equivalent command during the update:

dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll search --query Widget --regex --lang cs --json --db .cdidx/codeindex.db

It returned exit 3 with error_code: query_only_wal_changed and guidance to let the writer finish. The in-progress index operation was the documented local index . --files ... --db .cdidx/codeindex.db --json refresh, which expanded the C# workspace update set.

Requested scope

Make the search-alternative fixture hermetic with an isolated database/project context, while preserving assertions about absent explicit --db/--data-dir replay flags where those are the contract. Audit nearby tests for the same ambient database dependency only where the setup can naturally be shared. Do not weaken the snapshot safety check.

Validate both target frameworks and prove the fixture is independent of a busy or changing repository index. Found during #5260; this follow-up is outside that implementation PR.

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