Repository navigation
test(pyamber): share storage, RPC, and table test fixtures - #9623
aglinxinyuan wants to merge 2 commits into
Conversation
Deduplicate repeated S3 patch context helpers, RPC/handler mock builders, and table/batch-operator test fixtures across seven pyamber test files with identical test names and assertions.
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9623 +/- ##
=========================================
Coverage 91.68% 91.68%
Complexity 5135 5135
=========================================
Files 1302 1302
Lines 58119 58120 +1
Branches 7582 7582
=========================================
+ Hits 53285 53286 +1
Misses 2923 2923
Partials 1911 1911
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 693 | 0.423 | 13,577/21,301/21,301 us | 🟢 -9.0% / 🔴 +63.4% |
| ⚪ | bs=100 sw=10 sl=64 | 1,715 | 1.047 | 57,560/68,430/68,430 us | ⚪ within ±5% / 🟢 -29.4% |
| 🔴 | bs=1000 sw=10 sl=64 | 1,951 | 1.191 | 500,106/630,212/630,212 us | 🔴 +9.8% / 🟢 +33.2% |
Baseline details
Latest main f030df1 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 693 tuples/sec | 716 tuples/sec | 1,055 tuples/sec | -3.2% | -34.3% |
| bs=10 sw=10 sl=64 | MB/s | 0.423 MB/s | 0.437 MB/s | 0.644 MB/s | -3.2% | -34.3% |
| bs=10 sw=10 sl=64 | p50 | 13,577 us | 14,916 us | 9,804 us | -9.0% | +38.5% |
| bs=10 sw=10 sl=64 | p95 | 21,301 us | 19,835 us | 13,039 us | +7.4% | +63.4% |
| bs=10 sw=10 sl=64 | p99 | 21,301 us | 19,835 us | 15,330 us | +7.4% | +39.0% |
| bs=100 sw=10 sl=64 | throughput | 1,715 tuples/sec | 1,730 tuples/sec | 1,418 tuples/sec | -0.9% | +20.9% |
| bs=100 sw=10 sl=64 | MB/s | 1.047 MB/s | 1.056 MB/s | 0.866 MB/s | -0.9% | +20.9% |
| bs=100 sw=10 sl=64 | p50 | 57,560 us | 56,890 us | 76,126 us | +1.2% | -24.4% |
| bs=100 sw=10 sl=64 | p95 | 68,430 us | 69,898 us | 83,699 us | -2.1% | -18.2% |
| bs=100 sw=10 sl=64 | p99 | 68,430 us | 69,898 us | 96,885 us | -2.1% | -29.4% |
| bs=1000 sw=10 sl=64 | throughput | 1,951 tuples/sec | 2,011 tuples/sec | 1,465 tuples/sec | -3.0% | +33.2% |
| bs=1000 sw=10 sl=64 | MB/s | 1.191 MB/s | 1.227 MB/s | 0.894 MB/s | -2.9% | +33.2% |
| bs=1000 sw=10 sl=64 | p50 | 500,106 us | 489,471 us | 744,765 us | +2.2% | -32.9% |
| bs=1000 sw=10 sl=64 | p95 | 630,212 us | 573,731 us | 781,322 us | +9.8% | -19.3% |
| bs=1000 sw=10 sl=64 | p99 | 630,212 us | 573,731 us | 823,669 us | +9.8% | -23.5% |
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,288.67,200,128000,693,0.423,13577.17,21301.30,21301.30
1,100,10,64,20,1166.14,2000,1280000,1715,1.047,57559.92,68430.27,68430.27
2,1000,10,64,20,10252.37,20000,12800000,1951,1.191,500105.68,630211.88,630211.88- Give `_make_channel` an `is_control` parameter so `_dispatch` reuses it instead of building the same `ChannelIdentity` inline. - Keep the literal expected DataFrame in `test_table.py`, so `test_table_from_data_frame` and `test_use_table_as_data_frame` compare against values and column order that do not come from `target_raw_tuples`. - Restore `@pytest.mark.timeout(5)` on `test_write_unblocks_when_upload_fails_with_full_queue` (`close()` joins the upload thread with no limit) and patch S3 through `_mock_s3_upload()`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What changes were proposed in this PR?
Shares repeated test setup, mock scaffolding, and assertion helpers across seven
pyamberunit test suites without changing test coverage or production code:test_large_binary_output_stream.py, preserving all literal assertions, patch lifetimes, thread-gate checks, and error scopes.test_debug_command_handler.py,test_evaluate_expression_handler.py,test_async_rpc_client.py, andtest_async_rpc_server.py.test_table.pyandtest_count_batch_operator.py.All existing test names and assertions are preserved.
Any related issues, documentation, discussions?
Closes #9622.
How was this PR tested?
Ran in
amber/againstorigin/main(f030df12b7) before and after the refactor on Python 3.12:ruff check src/main/python src/test/pythonandruff format --check src/main/python src/test/python: passed.119passed,0failed,0skipped (0test name/outcome diffs across all 7 suites).large_binary_output_stream.py(if large_binary is None:),async_rpc_server.py(return command_id < 0), andcount_batch_operator.py(self.count += 1) each failed its guarding suite (rc=1), confirming the refactored assertions remain live.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Antigravity (Gemini), Claude Code (Claude Opus 5.5)