test: isolate config-path readers from env redirects#4483
Conversation
Config path writers already held the process-wide test environment mutex, but readers did not. Concurrent provider tests could therefore resolve and write through another test temporary DEEPSEEK_CONFIG_PATH or CODEWHALE_CONFIG_PATH, especially under Windows timing. Make test-only config path reads respect that mutex while allowing reentrant reads by its owner. Add cross-thread regression coverage and assert that EnvVarGuard mutations hold the lock. Fixes #4463 Signed-off-by: Hunter B <hmbown@gmail.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Claude finished @Hmbown's task in 4m 45s —— View job Review: test-isolate config-path readers from env redirects
SummaryThis is a well-scoped,
Design note (not a bug, worth a short comment somewhere): because Production (non-test) behavior is unchanged — both No correctness bugs, no provider/model-routing concerns (none of this touches that code), no security issues, and test coverage for the new behavior is solid. I wasn't able to execute |
Summary
Fixes the test-environment reader race behind the intermittent Windows provider-persistence failures in #4463.
CODEWHALE_CONFIG_PATHandDEEPSEEK_CONFIG_PATHreaders with the existing process-wide environment lockEnvVarGuardassert that callers actually hold the lockProduction config-path behavior is unchanged; the synchronization is
cfg(test)only.Closes #4463
Verification
codewhale-tuisuite: 7,111 passed, 0 failed, 2 ignoredcargo check -p codewhale-tuicargo check -p codewhale-tui --testsThe remaining acceptance gate is native
windows-latestCI. Local cross-compilation on macOS stopped inringbecause the Windows SDK headerassert.his unavailable, before Codewhale code compiled.