Skip to content

test(rocksdb): re-enable test_open_rocksdict with a faithful rocksdict mock#720

Merged
wbarnha merged 2 commits into
masterfrom
claude/reenable-rocksdb-store-test
Jul 21, 2026
Merged

test(rocksdb): re-enable test_open_rocksdict with a faithful rocksdict mock#720
wbarnha merged 2 commits into
masterfrom
claude/reenable-rocksdb-store-test

Conversation

@wbarnha

@wbarnha wbarnha commented Jul 20, 2026

Copy link
Copy Markdown
Member

Description

Re-enables TestRocksDBOptions::test_open_rocksdict, skipped as "Need to make mock BlockBasedOptions".

The test patched only faust.stores.rocksdb.rocksdict, but the store's use_rocksdict path also uses the bare module-level Options/DB names, so Options(raw_mode=True) reached the real object and raised TypeError: Options() takes no arguments (rocksdict isn't installed in CI).

Fix (test-only): mock the full external rocksdict surface used by the store — Options, DB, BlockBasedOptions, Cache, ReadOptions, BlockBasedIndexType — and assert the store drives it correctly: Options(raw_mode=True), create_if_missing(True), the field-driven setters (max_open_files, write_buffer_size, …), the block-based table factory (bloom filter, block cache, binary-search index), DB(str(path), options=…, access_type=…), and set_read_options. Only the external library is mocked; open()/as_options() run for real. Assertions are strictly stronger than the stale original.

Verification

tests/unit/stores/test_rocksdb.py96 passed; flake8/black/isort clean. Fix was produced under adversarial faithfulness review (confirmed no gutted assertions, mocks stand in only for the external lib).

🤖 Generated with Claude Code


Generated by Claude Code

…t mock

The test was skipped ("Need to make mock BlockBasedOptions") because it
patched only `faust.stores.rocksdb.rocksdict` -- the store's rocksdict path
also uses the bare module-level `Options`/`DB` names, so `Options(raw_mode=True)`
hit the real object and raised "Options() takes no arguments" (rocksdict is
not installed in CI).

Mock the external rocksdict surface (Options, DB, BlockBasedOptions, Cache,
ReadOptions, BlockBasedIndexType) and assert the store drives it correctly --
Options(raw_mode=True), create_if_missing, the field-driven setters, the
block-based table factory, DB(path, options=..., access_type=...), and
set_read_options.  Only the external library is mocked; open()/as_options()
run for real.  Assertions are strictly stronger than the stale original.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HHPL4VFWQRQPpjR1gXSKyL
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.36%. Comparing base (f77a678) to head (86c7c03).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #720      +/-   ##
==========================================
+ Coverage   94.18%   94.36%   +0.17%     
==========================================
  Files         104      104              
  Lines       11154    11154              
  Branches     1202     1202              
==========================================
+ Hits        10505    10525      +20     
+ Misses        548      530      -18     
+ Partials      101       99       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wbarnha
wbarnha enabled auto-merge July 21, 2026 11:13
@wbarnha
wbarnha added this pull request to the merge queue Jul 21, 2026
Merged via the queue into master with commit 69c15a3 Jul 21, 2026
24 checks passed
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.

1 participant