Skip to content

fix(test): centralize registry sync to prevent parallel git clone races#1651

Merged
houko merged 1 commit into
mainfrom
fix/ci-test-isolation
Mar 25, 2026
Merged

fix(test): centralize registry sync to prevent parallel git clone races#1651
houko merged 1 commit into
mainfrom
fix/ci-test-isolation

Conversation

@houko
Copy link
Copy Markdown
Contributor

@houko houko commented Mar 25, 2026

Summary

CI 测试三平台全挂,根因是多个 crate 的测试并行调 sync_registry() → 并发 git clone 同一目录 → 竞争失败。

修复

把 auto-sync 逻辑收敛到 resolve_home_dir_for_tests() 内部,用 OnceLock 确保每个进程只同步一次。各 crate 的 test helper 简化为直接调用该函数。

改动文件

文件 改动
registry_sync.rs resolve_home_dir_for_tests() 内置 OnceLock + auto-sync
model_catalog.rs test_catalog() 简化
routing.rs test_catalog()Default 改为用共享 home
kernel/metering.rs test_catalog() 简化
kernel/router.rs ensure_registry() 简化
extensions/registry.rs ensure_registry() 简化
extensions/installer.rs ensure_registry() 简化
hands/registry.rs ensure_test_home() 简化

Test plan

  • cargo test --workspace --lib 本地全绿 (3063 passed)

Multiple test modules across crates called sync_registry() directly,
causing concurrent git clone races when tests run in parallel threads.

Move the auto-sync logic into resolve_home_dir_for_tests() behind a
OnceLock so the registry is synced exactly once per process. All test
helpers now just call resolve_home_dir_for_tests() without manual sync.

Affected crates: runtime, kernel, extensions, hands.
@houko houko merged commit bc4963a into main Mar 25, 2026
@houko houko deleted the fix/ci-test-isolation branch March 25, 2026 12:50
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added area/runtime Agent loop, LLM drivers, WASM sandbox area/kernel Core kernel (scheduling, RBAC, workflows) area/security Security systems and auditing labels Mar 25, 2026
@houko houko mentioned this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/kernel Core kernel (scheduling, RBAC, workflows) area/runtime Agent loop, LLM drivers, WASM sandbox area/security Security systems and auditing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant