Skip to content

Conversation

@code-yeongyu
Copy link
Owner

@code-yeongyu code-yeongyu commented Jan 30, 2026

This PR is generated using Hephaestus.

πŸ† SPECIAL PR: Test Suite Optimization

Major test performance improvements through fake timer implementations and race condition fixes.


⚑ Performance Impact

Test File Before After Improvement
todo-continuation-enforcer.test.ts 104.6s 7.0s πŸš€ 15x faster
executor.test.ts ~26s 6.8s πŸš€ 4x faster
callback-server.test.ts 38ms 102ms Race condition fix
concurrency.test.ts 13ms 14ms Quality improvement

Total time saved per test run: ~117 seconds πŸŽ‰


πŸ“ Changes

  1. test(todo-continuation-enforcer): use FakeTimers for 15x faster tests

    • Custom FakeTimers implementation (~100 lines)
    • Replace real setTimeout waits with fakeTimers.advanceBy()
  2. test(callback-server): fix race conditions with Promise.all and Bun.fetch

    • Use Bun.fetch.bind(Bun) to avoid globalThis.fetch mock interference
    • Use Promise.all pattern for concurrent operations
    • Add Bun.sleep(10) cleanup in afterEach
  3. test(concurrency): replace placeholder assertions with getCount checks

    • Replace 6 meaningless expect(true).toBe(true) with actual verifications
  4. refactor(config-handler): simplify planDemoteConfig creation

    • Remove unnecessary IIFE and destructuring
  5. test(executor): use FakeTimeouts for faster tests

    • Same FakeTimeouts pattern for executor tests

βœ… Verification

  • All 77 tests pass across 4 modified test files
  • TypeScript compilation: βœ… No errors
  • Test execution time: 23.92s (down from ~140s)

plan agent should only inherit model settings from prometheus,
not the prompt or permission. This ensures plan agent uses
OpenCode's default behavior while only overriding the model.
- Add custom FakeTimers implementation (~100 lines)
- Replace all real setTimeout waits with fakeTimers.advanceBy()
- Test time: 104.6s β†’ 7.01s
…etch

- Use Bun.fetch.bind(Bun) to avoid globalThis.fetch mock interference
- Use Promise.all pattern for concurrent fetch/waitForCallback
- Add Bun.sleep(10) in afterEach for port release
Replace 6 meaningless expect(true).toBe(true) assertions with
actual getCount() verifications for test quality improvement
Remove unnecessary IIFE and destructuring, use direct spread instead
- Add custom FakeTimeouts implementation
- Replace setTimeout waits with fakeTimeouts.advanceBy()
- Test time reduced from ~26s to ~6.8s
@code-yeongyu code-yeongyu changed the title πŸ† test: AI Battle Royale - Merge best optimizations from Codex & OMO πŸ† test: optimize test suite with FakeTimers and race condition fixes Jan 30, 2026
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@code-yeongyu code-yeongyu merged commit 8c2625c into dev Jan 30, 2026
8 checks passed
@code-yeongyu code-yeongyu deleted the test-optimization-merge branch January 30, 2026 13:10
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.

3 participants