Skip to content

test(storage): align semantic processor fakes with pathlock lease and localized overview heading - #3841

Closed
huangruiteng wants to merge 1 commit into
volcengine:mainfrom
huangruiteng:fix/issue-storage-semantic-test-fakes
Closed

test(storage): align semantic processor fakes with pathlock lease and localized overview heading#3841
huangruiteng wants to merge 1 commit into
volcengine:mainfrom
huangruiteng:fix/issue-storage-semantic-test-fakes

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

Problem

Three stale test doubles/assertions in tests/storage fail on main at 674f5e60:

  1. test_semantic_processor_language.py::test_overview_generation_language_flow[zh-CN] — the semantic/overview_generation.yaml template renders the section heading as 简要描述 for zh-CN and Brief Description otherwise (template line 59), but the test always asserted "Brief Description", so the zh-CN parametrization failed while en/ja passed.
  2. test_semantic_processor_mv_vector_store.py::test_mv_canonicalizes_user_shorthand_before_vector_updateVikingFS.mv now acquires a pathlock lease via _async_agfs.pathlock_acquire_batch and passes the resulting lease dict through _pathlock_fs_ctx. The test left that mock auto-returning an AsyncMock, which _pathlock_fs_ctx rejects with ValueError: lease_ref must be a non-empty string or lease dictionary.
  3. test_semantic_queue_memory_dedupe.py::test_stale_memory_semantic_write_is_skippedwrite_semantic_sidecars now calls VikingFS.write_file(..., lease_ref=...), but the test's _FakeVikingFS.write_file did not accept the kwarg (TypeError: ... got an unexpected keyword argument 'lease_ref').

These are the same stale-test-fake class as already-fixed #3758/#3835/#3839.

Change

Test-only:

  • Assert the language-appropriate overview heading (简要描述 for zh-CN).
  • Stub pathlock_acquire_batch to return a {'lease_ref': 'lease-1'} dict in the mv test.
  • Add lease_ref=None to _FakeVikingFS.write_file.

No product code changed.

Tests

PYTHONPATH="$PWD" .venv/bin/python -m pytest   tests/storage/test_semantic_processor_language.py   tests/storage/test_semantic_processor_mv_vector_store.py   tests/storage/test_semantic_queue_memory_dedupe.py   -p no:cacheprovider --no-cov -q
74 passed, 4 warnings in 0.49s

The remaining failures under tests/storage are covered by other open Draft PRs (#3807 openGauss update_data, #3808 qdrant caplog, #3813 mock adapter, #3777 volcengine update_data) or are environmental (bulk_upsert missing PersistStore native symbol).

… localized overview heading

Three stale test doubles/assertions in tests/storage fail on main at 674f5e6:

- test_semantic_processor_language.py: the overview_generation template
  renders the section heading as '简要描述' for zh-CN and 'Brief
  Description' otherwise, but the test always asserted 'Brief
  Description', failing the zh-CN parametrization. Assert the
  language-appropriate heading.
- test_semantic_processor_mv_vector_store.py: VikingFS.mv now acquires a
  pathlock lease via _async_agfs.pathlock_acquire_batch and passes the
  resulting lease dict through _pathlock_fs_ctx. The test left that mock
  auto-returning an AsyncMock, which _pathlock_fs_ctx rejects. Stub it to
  return a {'lease_ref': ...} dict.
- test_semantic_queue_memory_dedupe.py: write_semantic_sidecars now calls
  VikingFS.write_file(..., lease_ref=...), but _FakeVikingFS.write_file
  did not accept the kwarg. Add lease_ref to the fake.

Test-only changes. 74 tests across the three files pass.
@huangruiteng

Copy link
Copy Markdown
Collaborator Author

Closed by the Ark/LoopX community-hygiene audit: this Draft was produced from a local test sweep without an accepted upstream issue or maintainer-owned task, so it is outside the current issue-fix qualification boundary. The source branch is intentionally retained; this PR may be reopened after explicit issue qualification and a fresh competing-PR check.

@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant