Skip to content

Simulate slow agent starts in the distribution harness so #3753's convergence failures reproduce at dev scale #3779

Description

@jeremydmiller

Follow-up to #3753 and to JasperFx/jasperfx#598 (move the blue/green side-effect gate warm-up out of the agent start path).

Why

Every issue in the #3753 chain — #3748, #3749, #3750, JasperFx/jasperfx#594 and now JasperFx/jasperfx#598 — takes a slow agent start as its precondition. #3748 and #3750 genuinely require one; #3749's phantom stops look structural but are amplified by one.

Right now nothing in that chain reproduces at dev scale. The only verification site is the reporting customer's restored-production canary (512 tenant databases, ~6,500 agents, 5 nodes), which means:

  • every candidate fix has to be shipped as a pinned prerelease and measured by someone else, on their schedule;
  • we cannot write a regression test for any of the three defects already closed, so nothing stops them coming back;
  • the emergent behaviour that actually bites — the observed peak of 60 concurrent warm-ups, the total assigned-agent count going down over a four-minute window — is invisible to dotnet test.

FakeAgent.StartAsync currently returns Task.CompletedTask. That is precisely the assumption the whole chain violates.

What to build

A test seam that makes agent start cost configurable, then a distribution test at a scale that matters:

src/Testing/CoreTests/Runtime/Agents/scale_safe_batch_starts.cs is the closest existing precedent and probably where this lands.

Assertions worth having

Caveat, stated up front

A simulation is not a substitute for the canary. The pathologies in #3753 are emergent from real database contention, real node-table timing and real chunk sizes, and a fake-agent harness will reproduce the shape of the problem, not its magnitude. Sign-off on "a deploy carrying a projection version bump converges quickly on its own" almost certainly still needs the reporting customer's cluster, and they have offered to run diagnostics against a pinned prerelease.

The value here is the other direction: a dev-scale reproduction lets us iterate and reject bad fixes in minutes instead of round-tripping every candidate through someone else's production restore, and it gives the three closed defects regression coverage they do not currently have.

🤖 Generated with Claude Code

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