Skip to content

DiagnosticSanitizer can time out while sanitizing plugin registry diagnostics #3292

Description

@Widthdom

Problem

A full Release test run on the latest origin/main plus PR branch hit a RegexMatchTimeoutException while sanitizing an extractor plugin registry diagnostic.

Evidence

Command:

dotnet test CodeIndex.sln -c Release --no-build

Observed failure:

CodeIndex.Tests.ExtractorPluginRegistryTests.LoadPluginAssemblies_RetainsCapDiagnosticWhenCandidatesAlsoFailToLoad
System.Text.RegularExpressions.RegexMatchTimeoutException
at CodeIndex.Diagnostics.DiagnosticSanitizer.ForMessage(String message)
at CodeIndex.Indexer.Extensibility.ExtractorPluginRegistry.RecordDiagnostic(...)

The same test passed when rerun alone with:

dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Release --no-build --framework net8.0 --filter "FullyQualifiedName~ExtractorPluginRegistryTests.LoadPluginAssemblies_RetainsCapDiagnosticWhenCandidatesAlsoFailToLoad"

Impact

Full test runs can fail nondeterministically under load when diagnostic sanitization hits the regex timeout path.

Scope note

Discovered while validating PR #3282; not part of that PR's intended issue-fix scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions