Skip to content

Optimize Test Suite Performance to Improve Developer Efficiency #289

@bhouston

Description

@bhouston

Slow Test Execution Time Reducing Developer Efficiency

Problem

The current test suite running via pnpm test is taking too long to execute, which is reducing developer efficiency. Long test times slow down the development cycle, especially when running tests frequently during development.

Impact

  • Reduced development velocity
  • Developers may skip running tests locally due to long wait times
  • Increased context switching as developers wait for tests to complete
  • Longer CI/CD pipeline execution times

Current State

I've analyzed the test execution and identified several key factors contributing to the slow test performance:

  1. Browser-based tests are particularly slow

    • Tests involving browser initialization, navigation, and waiting for elements are taking 3-6 seconds each
    • Browser tests account for a significant portion of the total test time
    • Each browser test suite initializes a new browser instance
  2. External dependencies slow down tests

    • Many tests make real HTTP requests to external websites (e.g., https://the-internet.herokuapp.com)
    • Network latency and external server response times add unpredictable delays
  3. Long wait times and timeouts

    • Default timeouts are set high (30000ms for browser operations)
    • Many tests include explicit waits for elements or state changes
    • Some tests intentionally simulate slow operations
  4. Process handling in shell tests

    • Shell tests start real processes and wait for them to complete
    • Tests include sleep periods to allow processes to run
  5. Sequential test execution

    • Tests run sequentially rather than in parallel
    • No selective test running capabilities for faster feedback cycles

I'll follow up with proposed solutions in the comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions