Skip to content

[CI flake] CookieStore pending-acquisition test loses a concurrent invocation #40

Open

Description

@mmitche

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Microsoft.AspNetCore.Components.Platform.Tests.CookieStoreTest.CookieStore_SharesPendingAcquisitionBetweenCallers intermittently records one JavaScript object-reference invocation after both concurrent callers complete, although the test expects two.

Affected builds and PRs

PR PR target branch Build(s) Notes
dotnet/aspnetcore#70496 main 1674992 Failed in the macOS arm64 Helix work item on Helix stage attempt 1; stage attempt 2 passed.

Failure

Assert.Equal() Failure: Values differ
Expected: 2
Actual:   1
at Microsoft.AspNetCore.Components.Platform.Tests.CookieStoreTest.CookieStore_SharesPendingAcquisitionBetweenCallers()

Possible cause

The two operations resume concurrently when the shared acquisition completes. The test double records both calls with an unsynchronized List<Invocation>.Add; concurrent writes can lose an entry even when both operations completed. The production acquisition count remained correct at one.

Evaluation and decision

A thread-safe recorder would make the assertion deterministic, but this run is prioritizing the repeated HTTP/2 stream-pool race for the bounded prototype. Track this candidate for a focused follow-up rather than combining unrelated test fixes.

Coverage and validation gaps

The failure occurred on macOS arm64. This Windows host can inspect and run the test but cannot validate macOS runtime scheduling directly.

Activity

  1. mmitche commented on Nov 18, 2026

    @mmitche
    OwnerAuthor

    Automated Copilot triage cross-link.

    Upstream tracking is now dotnet/aspnetcore#70697. The new occurrence is build 1685336 for dotnet#70664: CookieStore_SharesPendingAcquisitionBetweenCallers again observed Expected: 2, Actual: 1, then passed when the same build record was retried.

    The repeated exact signature supports the existing hypothesis that the test double's unsynchronized invocation list loses a concurrent write. A test-only thread-safe recorder candidate is being evaluated.

  2. mmitche commented on Nov 18, 2026

    @mmitche
    OwnerAuthor

    Candidate publication update from the automated Copilot triage run.

    The narrow test-only fix was committed as f5b7324b50099818a8984f2361d7db29261dcd4b on fork branch mmitche-ci-flakiness-cookiestore-20261118. It replaces the test double's concurrent List.Add recorder with ConcurrentQueue.Enqueue.

    Targeted repository validation was blocked because the repo pins .NET SDK 12.0.100-alpha.1.26557.102 and the host has 10.0.403. The required upstream draft PR command failed with gh: Resource not accessible by integration (HTTP 403). Verification found no upstream or fork PR for the branch, so the candidate branch is preserved without a PR.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions