Skip to content

Reduce CI latency with isolated full-suite shards and serialized nightly runs #2465

Closed

Description

@integry

Improve CI latency without reducing test coverage. User authorized inspecting [email protected] and improving CI configuration. Host audit: one online idle self-hosted runner labeled propr, 12 CPUs/62 GiB RAM, no resource quota; it runs test-nightly.yml. PR checks run on GitHub-hosted ubuntu/macOS machines, not this host. Do not change production services, credentials, runner permissions, branch protection, or deployments.

Observed PR #2458 head 0806cce: full suite run 35712445941 took ~14 minutes (actual tests 12m19s, install 16s); desktop run 35712445891 ~21 minutes, including linux-x64 staged native install lifecycle step 10m20s. Full suite runner scripts/run-test-suite.mjs executes files sequentially and flushes its isolated Redis between files. Existing cancellation of superseded PR runs already works.

Implement a bounded first improvement on current main:

  1. Add deterministic complete sharding to scripts/run-test-suite.mjs and run the PR full suite across four independent GitHub-hosted jobs. Preserve sequential execution inside each shard and per-job isolated Redis and data directories. Include every discovered server test AND native workspace test exactly once; avoid native workspace duplication in all shards. Validate shard index/count strictly; default unsharded CLI/nightly behavior remains unchanged. Use a dry-run/list manifest or equivalent evidence to prove partition completeness. Prefer simple deterministic partitioning initially; emit per-file/workspace timing and shard summary for later balancing.
  2. Preserve the existing required check name 'Run Full Test Suite' as an aggregate gate, with always() and explicit handling: fail if any expected shard fails, is cancelled or unexpectedly skipped; intentional draft behavior must stay correct. Keep per-PR cancel-in-progress and secretless PR jobs; unique sanitized artifacts per shard and actionable failure reporting. Do not move PR execution onto the root production runner. Do not change branch protection or remove checks. Preserve test preparation and docs validation, avoid needless docs builds per shard if a separate existing/required job can enforce them once safely.
  3. Add workflow-scoped concurrency to nightly validation so manual and scheduled runs cannot overlap on the same target; do not cancel an active live E2E run just because another queues. Keep nightly live tests and failure reporting intact. Do not mask the observed live OpenCode timeout by removing a model or widening timeout.
  4. Add tests for shard coverage/disjointness/native workspaces, invalid shard config, and gate success/failure/cancellation behavior where appropriate. Run runner tests, YAML/actionlint, relevant checks and validate complete discovery. Run actual shard jobs via resulting PR CI and report timings; do not claim speedup based only on division.

Desktop latency: inspect the referenced lifecycle step and identify a concrete safe wait/setup optimization if present. Only implement it if verified with regression coverage and without weakening installation, cleanup or artifact acceptance. Otherwise leave desktop behavior unchanged and report the bottleneck precisely as follow-up; don't broaden this PR into path-based coverage reduction or release policy changes.

Keep this focused. Goal: lower wall-clock time while retaining the same merge confidence. Deliver an ordinary PR, do not merge it or deploy anything. Explain which improvements take effect only after merge. User's existing unrelated host worktrees are modified; do not touch them.

Activity

  1. propr-dev commented on Sep 22, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude agent with claude-opus-5 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5
    • Branch: 2465/claude-opus-5-reduce-ci-latency-with-is-20260922-1025-5k9
    • Base Branch: main
    • Worktree: issue-2465-20260922-1025-claude-opus-5-5k9

    🔍 Track Task Execution

  2. integry commented on Sep 22, 2026

    @integry
    OwnerAuthor

    Concrete desktop bottleneck found: apps/desktop/scripts/test-native-artifact-lifecycle.mjs extractRpm() races process completion against delay(timeout), default COMMAND_TIMEOUT_MS=600000, without cancelling the losing timer. The PR #2458 linux-x64 log prints successful lifecycle JSON at 09:58:26 but the step exits at 10:07:49. Local reproduction calling extractRpm with converterFile/extractorFile both /bin/true and timeout:2000 finishes the operation in 7ms but its fresh Node subprocess exits after 2127ms. Fix with an explicitly cleared deadline timer on all completion/error paths, preserving timeout and process cleanup behavior. Add a fresh-subprocess regression proving prompt natural exit after successful extraction; do not merely assert the async function resolves. Audit nearby Promise.race + delay deadlines for the same handle leak. This is a verified safe optimization within item 4/desktop investigation of this issue, not a request to remove coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions