Skip to content

test(base): fix the 11 jcode-base lib tests that fail on master (#1358) - #1360

Closed
ianalitis wants to merge 10 commits into
1jehuang:masterfrom
ianalitis:pr/base-suite-env-guard
Closed

ianalitis wants to merge 10 commits into
1jehuang:masterfrom
ianalitis:pr/base-suite-env-guard

Conversation

@ianalitis

Copy link
Copy Markdown
Contributor

Fixes #1358.

Root cause

The issue was filed as a thread-count race, but on re-check all 11 also fail with --test-threads=1. They are code-vs-test drift plus two environment leaks:

Test Cause
auth::codex::tests::multi_account_active_switch_works c71a598 switched to animal labels; fixture still expected openai-1/openai-2
auth::oauth::tests::basic::save_claude_tokens_preserves_existing_account_metadata same (claude-1 -> claude-otter)
provider::tests::test_same_provider_account_candidates_include_other_openai_accounts same
auth::cursor::tests::vscdb_missing_key_returns_error asserts the old error text; native rusqlite returns QueryReturnedNoRows
auth::tests::cursor_status_is_available_for_authenticated_cli_session, full_and_fast_auth_status_document_cursor_cli_exception Cursor readiness is native-only now; tests still modelled the CLI path
config::tests::config_env_fingerprint_tracks_every_apply_env_override_var apply_env_overrides reads JCODE_MEMORY_JEV_PROVIDER (2e6e423) but CONFIG_ENV_KEYS never listed it. This is a real bug: config cache fingerprint ignores that var
config::tests::test_generated_default_config_has_expected_user_defaults asserts a reasoning effort "none" comment the memory section no longer contains
prompt::prompt_tests::test_skill_prompt_integration 2483892 reworded the identity line to You are Jcode.
platform::platform_tests::spawn_detached_creates_new_session child wrote its sid via ps -o sid=, which is not portable; read getsid(child) from the parent instead
session::tests::cases::streaming_guard_creates_visible_macos_sleep_assertion global pmset substring match fails whenever any other jcode process is streaming; count this pid's assertions vs a baseline

Only CONFIG_ENV_KEYS is a non-test change (one line).

Evidence (macOS aarch64, 11 cores)

origin/master 2a4edaa02:   1472 passed, 11 failed   (parallel and --test-threads=1)
this branch:               1482 passed,  0 of those 11 fail (3 parallel runs + 1 serial)

Unrelated intermittent failures seen on both base and branch: background::tests::adopted_task_output_exists_while_running_and_is_replaced_on_completion, jev::tests::browser_auth_billing_and_redirect_failures_never_retry_or_fallback, jev::tests::failed_preflight_does_not_send_decision_request, provider::stream_timeout::tests::effort_scaling_never_shrinks_the_base_budget. Not touched here.

cargo clippy -p jcode-base --lib --tests: no new warnings vs master. cargo fmt --check clean.

… text

CONFIG_ENV_KEYS missed JCODE_MEMORY_JEV_PROVIDER, which apply_env_overrides
reads, so the fingerprint test failed. The generated default-file assertion
also referenced a 'reasoning effort "none"' comment the memory section no
longer documents; assert on the JCODE_MEMORY_SIDECAR_ENABLED override
instead.
The system prompt was reworded in 2483892; the skill-integration test still
looked for the previous sentence.
Other jcode processes on the machine hold the same assertion reason, so a
global substring check fails whenever a daemon or another session is
streaming. Compare per-pid assertion counts against a baseline instead.
@greptile-apps

greptile-apps Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

Safe to merge.

Summary

This update aligns stale jcode-base tests with current behavior and adds JCODE_MEMORY_JEV_PROVIDER to the configuration environment fingerprint. The memory-sidecar default test now directly verifies memory_sidecar_enabled = true, addressing the earlier coverage gap.

Reviews (2) · Last reviewed commit: "Update crates/jcode-base/src/config_test..."

Comment thread crates/jcode-base/src/config_tests.rs Resolved
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@1jehuang

Copy link
Copy Markdown
Owner

Thanks for the thorough breakdown! Current master already has these fixed: cargo test -p jcode-base --lib passes 1587/0 at default threads, and JCODE_MEMORY_JEV_PROVIDER is in CONFIG_ENV_KEYS. Closing as superseded.

@1jehuang 1jehuang closed this Sep 23, 2026
@ianalitis
ianalitis deleted the pr/base-suite-env-guard branch September 27, 2026 02:58
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.

cargo test -p jcode-base --lib fails 11 tests at the default thread count (process-global test state races)

2 participants