Skip to content

Fix flaky CachedDiscovery_CachedLoad_CompletesWithinTime perf test #608

@antonsynd

Description

@antonsynd

Problem

The CachedDiscovery_CachedLoad_CompletesWithinTime test in CachedDiscoveryPerformanceTests.cs uses a hardcoded 100ms threshold that is too tight for CI environments. The test failed at 109ms.

Root Cause

Line 149 uses a hardcoded 100 instead of the existing MinReasonableTimeMs constant (line 24). The constant's value of 100ms is also too low for CI runners with variable load.

Fix

  1. Rename MinReasonableTimeMs to CachedLoadThresholdMs and raise to 200
  2. Replace the hardcoded 100 on line 149 with the constant
  3. Update the assertion message to reference the constant name

Test Plan

  • Run the benchmark tests multiple times to verify no flakes
  • dotnet test --filter "FullyQualifiedName~CachedDiscoveryPerformanceTests"

Context

From the 2026-04-27 compiler health audit (W1).

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