Files
copilotkit__copilotkit/showcase/harness/test/integration/bubble-race-repro-defect-4.test.ts
Jordan Ritter 3d49d4c38f test(harness): bubble-race integration tests + defect reproductions
- bubble-race-repro.ts: shared driver harness for repro tests
- bubble-race-repro-defect-{1,2,3,4}.test.ts: real-browser RED tests
  that fail without the fix and pass with it
    - Defect 1: fast-replay false-positive settle on count
    - Defect 2: multi-turn flicker via list[last]
    - Defect 3: cascade-tier blindness
    - Defect 4: boot-time baseline staleness / pre-paint placeholder
- bubble-race-mechanisms.test.ts: GREEN tests pinning internal
  contracts (cascade-pollution guard, atomic readCascadeState,
  init-script idempotency)
- wait-for-turn-complete.test.ts: 3-conjunct classification matrix
- probe-contract.test.ts: ctx-bridge shape
- sse-counter.test.ts: counter increment + framenavigated reset +
  handle-cache invalidation
2026-06-15 18:37:26 -07:00

25 lines
1.1 KiB
TypeScript

import { describe, it, expect } from "vitest";
import { runBubbleRaceRepro } from "./bubble-race-repro.js";
describe("bubble-race repro (defect 4: boot-time baseline staleness)", () => {
it("first turn completes within 30s when a pre-paint placeholder is present", async () => {
const start = Date.now();
const result = await runBubbleRaceRepro({
slug: "langgraph-python:agentic-chat",
level: "d5",
messages: ["good name for a goldfish"],
prePaint:
'<div role="article" data-bubble-race-placeholder>placeholder</div>',
});
const elapsedMs = Date.now() - start;
expect(result.exitCode).toBe(0);
// Defect manifests as a 30s+ settle-timeout. Assertion is on
// observable wall-clock + first-turn text — NOT on internal log
// strings or internal exception types unique to the old
// implementation (the test must survive the deletion of
// `waitForAssistantSettled` in Phase 5).
expect(elapsedMs).toBeLessThan(30_000);
expect(result.turns[0].assistantText.trim().length).toBeGreaterThan(0);
}, 90_000);
});