Skip to content

Fix test noisiness#1066

Open
Muhammad-Bin-Ali wants to merge 3 commits intomainfrom
fix-test-noisiness
Open

Fix test noisiness#1066
Muhammad-Bin-Ali wants to merge 3 commits intomainfrom
fix-test-noisiness

Conversation

@Muhammad-Bin-Ali
Copy link
Contributor

Summary

Fixes noisy test output in the agents suite — DNS lookup failures and Durable Object invalidation errors that obscured real failures.

Changes

DNS lookup failures (eliminated)

  • tests/agents/mcp.ts — Mock connectToServer on TestHttpMcpDedupAgent to prevent real network calls to mcp.example.com
  • tests/mcp/client-manager.test.ts — Mock connectToServer in the restore+wait integration test to prevent calls to test.example.com

Durable Object invalidation (eliminated)

  • src/index.ts_scheduleNextAlarm() now calls deleteAlarm() when no schedules remain. Previously, cancelling the last schedule left an orphaned workerd alarm.
  • tests/schedule.test.ts — Cancel all interval schedules at end of tests (9 tests were leaving alarms active)
  • tests/message-handling.test.ts, tests/basepath.test.ts, tests/observability.test.ts — Add closeAndWait to WebSocket teardown so close handlers finish before module transitions
  • tests/mcp/transports/streamable-http.test.ts — Cancel unclosed SSE readers at end of tests

Remaining stderr noise

Intentional (tests exercising error paths, all have matching assertions):

  • state.test.ts — state validation rejection, duplicate hook guard
  • session/provider.test.ts — input validation (negative limit/offset)
  • workflow-error-reporting.test.ts — workflow throw/reject/error-reporting paths

Unintentional (miniflare mock limitations, no assertions):

  • workflow.test.tsEngine was never started / instance.not_found from miniflare's workflow binding when tests write to SQLite without creating real workflow instances

@changeset-bot
Copy link

changeset-bot bot commented Mar 4, 2026

⚠️ No Changeset found

Latest commit: 3d35179

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 4, 2026

Open in StackBlitz

npm i https://pkg.pr.new/agents@1066
npm i https://pkg.pr.new/@cloudflare/ai-chat@1066
npm i https://pkg.pr.new/@cloudflare/codemode@1066
npm i https://pkg.pr.new/hono-agents@1066

commit: 3b90550

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant