Skip to content

Optimize test performance: consolidate credentials tests#17

Merged
gricha merged 1 commit intomainfrom
ci/parallelize-tests
Jan 7, 2026
Merged

Optimize test performance: consolidate credentials tests#17
gricha merged 1 commit intomainfrom
ci/parallelize-tests

Conversation

@gricha
Copy link
Copy Markdown
Owner

@gricha gricha commented Jan 6, 2026

Summary

  • Consolidates credentials.test.ts from 4 separate describe blocks (each with its own agent) to 1 describe block with a shared agent
  • Each agent startup takes ~3s, so this saves ~9s of agent startup time
  • The test file went from 53s → 22s locally (~30s savings)

Background

The test CI job was taking ~6 minutes. Investigation showed:

  • Tests run sequentially (parallelization causes race conditions due to Docker resource contention)
  • The slowest tests are integration tests that create Docker containers (~8s per container)
  • credentials.test.ts was particularly inefficient with 4 separate agents

Impact

  • Local test time: ~170s (no change to total, but credentials tests now 22s vs 53s)
  • Expected CI improvement: ~30s off the test job

Future optimizations considered (but deferred):

  • Test parallelization (causes failures due to Docker conflicts)
  • Workspace reuse in cli.test.ts (risky - tests explicitly test create/delete)
  • Pre-warmed container pools (requires infrastructure changes)

Test plan

  • All 101 tests pass locally
  • CI tests pass and show improved timing

🤖 Generated with Claude Code

Previously, credentials.test.ts had 4 separate describe blocks, each
starting its own test agent (~3s startup each). This consolidates them
into a single describe block with one shared agent.

Expected CI improvement: ~30s savings in test duration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gricha gricha merged commit aa149e9 into main Jan 7, 2026
5 checks passed
@gricha gricha deleted the ci/parallelize-tests branch January 7, 2026 06:55
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