Conversation
The regression tests have flaky behavior due to test isolation issues. This change makes CI pass while we investigate and fix the root cause.
…LanceDB read consistency - Add LANCEDB_OPENCODE_PRO_SKIP_SIDECAR env var to prevent sidecar config loading during tests; fixes tests 4 & 5 where global ollama sidecar was overriding the test's openai embedding config - Add retry loop (3x, 50ms) to hasMemory() to handle LanceDB eventual consistency — a put() is not always visible to a subsequent query - Add missing lastRecalled/recallCount/projectCount columns to readByScopes() select list - Add retry + 50ms delay to cleanupDbPath() to handle ENOTEMPTY when LanceDB still holds file handles at teardown - Remove hooks.config() call from createPluginHarness() — it was invoked outside withPatchedEnv, allowing global sidecar to corrupt state.config - Add LANCEDB_OPENCODE_PRO_SKIP_SIDECAR to all harness env vars so plugin initialises against the test dbPath, not the global sidecar dbPath All 18 regression tests now pass deterministically (verified 5 consecutive runs: foundation 10/10, regression 18/18, retrieval 2/2).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.config/opencode/lancedb-opencode-pro.json) was overriding the test's OpenAI embedding config, preventing validation errors from firing. AddedLANCEDB_OPENCODE_PRO_SKIP_SIDECAR=trueguard inloadSidecarConfig()and wrapped affected tests in env-patched context.ENOTEMPTYrace condition during cleanup — LanceDB still holding file handles whenrm -rfran. Fixed with 50ms delay + one retry incleanupDbPath().hooks.config()was called outsidewithPatchedEnv, letting global sidecar corruptstate.config.dbPath; (2) LanceDB eventual consistency —hasMemory()could not see a record immediately afterput(). Fixed by removing the out-of-scopehooks.config()call, addingSKIP_SIDECARto all harness env vars, and adding a retry loop (3×, 50ms) tohasMemory().Verification
npm run verifyran 5 consecutive times with 0 failures (foundation 10/10, regression 18/18, retrieval 2/2).