Skip to content

[BUG] Flaky test: custom-tool-registry.spec.ts times out intermittently on CI #10277

@tupe12334

Description

@tupe12334

Description

The test should load tools from TypeScript files in packages/core/src/custom-tools/__tests__/custom-tool-registry.spec.ts intermittently times out after 60 seconds on CI runners.

Steps to Reproduce

  1. Open a PR that triggers CI
  2. The platform-unit-test job may fail with timeout
  3. Re-running the failed job often makes it pass

Evidence

Error Message

FAIL src/custom-tools/__tests__/custom-tool-registry.spec.ts > CustomToolRegistry > loadFromDirectory > should load tools from TypeScript files
Error: Test timed out in 60000ms.
If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".

Potential Causes

  1. esbuild compilation - Transpiling multiple TypeScript fixture files
  2. File I/O - Scanning directory and reading .ts files
  3. CI resource variability - Slower runners may exceed the 60s timeout
  4. No esbuild cache - Cold cache on CI causes slower compilation

Suggested Fixes

  1. Increase timeout for this specific test (e.g., 120000ms)
  2. Add esbuild caching for CI
  3. Reduce number of fixture files being compiled
  4. Mock esbuild in tests instead of actual compilation

Environment

  • CI: GitHub Actions
  • Platforms: ubuntu-latest, windows-latest
  • Test framework: Vitest

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions