Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Generated with mux

Fixes intermittent failures in:

  • tests/ipcMain/streamErrorRecovery.test.ts
  • tests/ipcMain/sendMessage.errors.test.ts

Root cause: Concurrent tests were racing on dynamic module imports (tokenizer, AI SDK providers) which could cause intermittent failures when modules weren't fully loaded before test execution.

Fix: Add preloadTestModules() call to beforeAll hooks inside the describeIntegration blocks, ensuring modules are loaded before any concurrent tests start.

Also moved beforeAll/afterAll hooks inside the describeIntegration blocks so they only run when integration tests are enabled.

Both streamErrorRecovery.test.ts and sendMessage.errors.test.ts were
failing intermittently with sendMessageWithModel returning success=false.

Root cause: concurrent tests were racing on dynamic module imports
(tokenizer, AI SDK providers) which could cause intermittent failures
when modules weren't fully loaded before test execution.

Fix: Add preloadTestModules() call to beforeAll hooks inside the
describeIntegration blocks, ensuring modules are loaded before any
concurrent tests start.

Also moved beforeAll/afterAll hooks inside the describeIntegration
blocks so they only run when integration tests are enabled.
@ammar-agent ammar-agent force-pushed the fix-stream-error-test-flakes branch from 514e0e9 to bf3cabe Compare November 25, 2025 02:46
@ammario ammario merged commit 2c5365a into main Nov 25, 2025
13 checks passed
@ammario ammario deleted the fix-stream-error-test-flakes branch November 25, 2025 02:58
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.

2 participants