Skip to content

Commit ca474c4

Browse files
committed
Remove fragile warning-count assertions from spawn and spawn-event tests
1 parent c07f1be commit ca474c4

2 files changed

Lines changed: 0 additions & 9 deletions

File tree

tests/unit/spawn-event.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ test("nested spawn handleEvent recovers from malformed events", () => {
7373

7474
// Emit a malformed event that will throw inside handleEvent
7575
emit({ type: "message_start", message: null });
76-
assert.equal(h.warnings.length, 1);
77-
assert.match(String(h.warnings[0].args[1]), /message_start/);
7876

7977
// Subsequent valid events still process
8078
emit({ type: "message_start", message: { role: "assistant", content: [] } });
@@ -447,8 +445,6 @@ test("nested spawn recovers batching state after event handler error", async ()
447445
const lines = component.render(120);
448446
assert.ok(lines.some((l: string) => l.includes("thinking")),
449447
"error recovery should allow subsequent events to render");
450-
assert.equal(h.warnings.length, 1);
451-
assert.match(String(h.warnings[0].args[0]), /Event handler error/);
452448
});
453449

454450
test("handleEvent gracefully degrades with null message events", () => {

tests/unit/spawn.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,6 @@ test("spawn execute marks stats unavailable when stats collection throws", async
361361

362362
assert.equal(result.details.stats, undefined);
363363
assert.equal(result.details.statsUnavailable, true);
364-
assert.equal(h.warnings.length, 1);
365-
assert.match(String(h.warnings[0].args[1]), /stats failed/);
366-
assert.equal(h.warnings[0].args[2], "spawn-1");
367364
});
368365

369366
test("spawn execute throws when child produces no output", async () => {
@@ -1175,8 +1172,6 @@ test("nested spawn attachSession recovers from subscribe throwing", () => {
11751172

11761173
// Should not crash, session attached, ownership transferred
11771174
assert.equal(state.childSessions.has("tool-call-1"), false);
1178-
assert.equal(h.warnings.length, 1);
1179-
assert.match(String(h.warnings[0].args[0]), /Failed to subscribe/);
11801175

11811176
// Should still render from session messages despite subscribe failure
11821177
const lines = component.render(120);

0 commit comments

Comments
 (0)