Skip to content

test(jetbrains): reduce unit test runtime - #12171

Merged
marius-kilocode merged 4 commits into
mainfrom
research-jetbrains-test-duration
Jul 13, 2026
Merged

test(jetbrains): reduce unit test runtime#12171
marius-kilocode merged 4 commits into
mainfrom
research-jetbrains-test-duration

Conversation

@marius-kilocode

@marius-kilocode marius-kilocode commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

The JetBrains pull-request check spends most of its time in two avoidable areas: frontend tests wait on fixed wall-clock sleeps even when their coroutine and EDT work is complete, and the CI job builds inside a container that cannot reuse the repository Gradle cache. The generated OpenAPI client also requires a clean build until its task outputs are modeled independently.

This change keeps the complete JetBrains test suite and improves the execution path without deleting coverage:

  • Replace fixed 500 ms and 1 s flush/settle sleeps in history, side-panel, and profile tests with the existing controlled coroutine dispatcher, deterministic draining, and explicit EDT pumping. The tests now wait for queued work rather than sleeping for a worst-case duration.
  • Inject the history controller IO dispatcher where tests need to control asynchronous work, while retaining Dispatchers.IO as the production default.
  • Reduce bounded settings polling from 100 ms intervals to 10 ms intervals without changing the completion predicates or timeout bounds.
  • Remove the connection test's race-prone wait on a mock-server latch and assert the observable Connected state after the readiness signal.
  • Run JetBrains CI on the Blacksmith host with pinned Bun, Temurin 21, and setup-gradle, so Gradle can use the host dependency and transform cache. The workflow no longer runs a workspace-wide Bun install because the CI collector only uses Bun built-ins.
  • Allow Gradle build-cache reuse by removing --no-build-cache while retaining clean to prevent stale generated OpenAPI classes.

The result preserves the existing JUnit artifact collection, --continue failure reporting, and full module coverage while making asynchronous tests deterministic and aligning CI with the cacheable host setup.

@marius-kilocode
marius-kilocode marked this pull request as ready for review July 13, 2026 14:10
Comment thread .github/workflows/test-jetbrains.yml Outdated
@kilo-code-bot

kilo-code-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • .github/workflows/test-jetbrains.yml
Previous Review Summary (commit 12beba3)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 12beba3)

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
.github/workflows/test-jetbrains.yml 71 The permanently read-only Gradle cache cannot be seeded by trusted main runs.
Files Reviewed (13 files)
  • .github/workflows/test-jetbrains.yml - 1 issue
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/app/KiloConnectionServiceTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/history/HistoryController.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/actions/HistorySessionActionsTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/SessionSidePanelManagerTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/history/HistoryControllerTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/settings/UserProfileConfigurableTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/settings/agents/AgentsSettingsUiTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/settings/agents/McpSettingsUiTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/settings/models/ModelsSettingsUiTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/settings/providers/ProvidersSettingsUiTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/testing/TestCoroutines.kt - 0 issues
  • packages/kilo-jetbrains/script/test-ci.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by gpt-5.6-sol · Input: 35.3K · Output: 2.8K · Cached: 158.2K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode enabled auto-merge (squash) July 13, 2026 15:58
@marius-kilocode
marius-kilocode merged commit 8784a0d into main Jul 13, 2026
29 checks passed
@marius-kilocode
marius-kilocode deleted the research-jetbrains-test-duration branch July 13, 2026 16:05
AlexOcculate pushed a commit to AlexOcculate/kilocode that referenced this pull request Jul 14, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
* test(jetbrains): reduce unit test runtime

* ci(jetbrains): reuse host Gradle cache

* ci(jetbrains): run tests on cached host

* ci(jetbrains): seed Gradle cache on main
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