test(pyamber): extend IO, packaging and storage-model coverage - #7019
test(pyamber): extend IO, packaging and storage-model coverage#7019aglinxinyuan wants to merge 1 commit into
Conversation
Extend the materialization-reader runnable, tuple and UDF-operator suites and add new tests for input_manager and virtual_document. Covers the uncovered guard, error and edge branches; tests stay hermetic with no real sleeps and nothing left running. No source changes.
Automated Reviewer SuggestionsBased on the
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 371 | 0.227 | 25,652/35,116/35,116 us | 🔴 +21.0% / 🔴 +122.2% |
| 🔴 | bs=100 sw=10 sl=64 | 783 | 0.478 | 127,059/159,936/159,936 us | 🔴 +8.2% / 🔴 +49.0% |
| ⚪ | bs=1000 sw=10 sl=64 | 907 | 0.554 | 1,097,395/1,147,577/1,147,577 us | ⚪ within ±5% / 🔴 -12.0% |
Baseline details
Latest main ab58d47 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 371 tuples/sec | 432 tuples/sec | 787.55 tuples/sec | -14.1% | -52.9% |
| bs=10 sw=10 sl=64 | MB/s | 0.227 MB/s | 0.264 MB/s | 0.481 MB/s | -14.0% | -52.8% |
| bs=10 sw=10 sl=64 | p50 | 25,652 us | 21,202 us | 12,255 us | +21.0% | +109.3% |
| bs=10 sw=10 sl=64 | p95 | 35,116 us | 36,156 us | 15,802 us | -2.9% | +122.2% |
| bs=10 sw=10 sl=64 | p99 | 35,116 us | 36,156 us | 19,008 us | -2.9% | +84.7% |
| bs=100 sw=10 sl=64 | throughput | 783 tuples/sec | 812 tuples/sec | 997.81 tuples/sec | -3.6% | -21.5% |
| bs=100 sw=10 sl=64 | MB/s | 0.478 MB/s | 0.496 MB/s | 0.609 MB/s | -3.6% | -21.5% |
| bs=100 sw=10 sl=64 | p50 | 127,059 us | 120,317 us | 100,690 us | +5.6% | +26.2% |
| bs=100 sw=10 sl=64 | p95 | 159,936 us | 147,857 us | 107,316 us | +8.2% | +49.0% |
| bs=100 sw=10 sl=64 | p99 | 159,936 us | 147,857 us | 113,823 us | +8.2% | +40.5% |
| bs=1000 sw=10 sl=64 | throughput | 907 tuples/sec | 901 tuples/sec | 1,030 tuples/sec | +0.7% | -12.0% |
| bs=1000 sw=10 sl=64 | MB/s | 0.554 MB/s | 0.55 MB/s | 0.629 MB/s | +0.7% | -11.9% |
| bs=1000 sw=10 sl=64 | p50 | 1,097,395 us | 1,111,775 us | 981,213 us | -1.3% | +11.8% |
| bs=1000 sw=10 sl=64 | p95 | 1,147,577 us | 1,136,662 us | 1,027,605 us | +1.0% | +11.7% |
| bs=1000 sw=10 sl=64 | p99 | 1,147,577 us | 1,136,662 us | 1,055,466 us | +1.0% | +8.7% |
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,538.58,200,128000,371,0.227,25652.49,35116.10,35116.10
1,100,10,64,20,2553.95,2000,1280000,783,0.478,127058.81,159935.50,159935.50
2,1000,10,64,20,22051.35,20000,12800000,907,0.554,1097395.23,1147576.67,1147576.67
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7019 +/- ##
============================================
+ Coverage 78.99% 79.18% +0.19%
Complexity 3788 3788
============================================
Files 1160 1160
Lines 46105 46105
Branches 5115 5115
============================================
+ Hits 36419 36509 +90
+ Misses 8067 7977 -90
Partials 1619 1619
*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:
|
There was a problem hiding this comment.
Pull request overview
This PR improves Python (pyamber/pytexera) test coverage for IO replay, packaging/input management, tuple serialization, and the storage model abstractions, without modifying production code. It aligns with issue #7017 by adding focused, hermetic unit tests that exercise previously uncovered branches and edge/error paths.
Changes:
- Extended
test_udf_operator.pyto cover_UiParameterSupportparsing failures, open-wrapper edge cases, and base-class default hook generator behavior. - Extended
test_input_port_materialization_reader_runnable.pyto cover tuple replay/partition filtering, channel bracketing ECMs, stop behavior, and error logging behavior. - Added dedicated new test files for
InputManagerandVirtualDocumentdefault/edge behaviors.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| amber/src/test/python/pytexera/udf/test_udf_operator.py | Adds coverage for UI parameter parsing/error paths and default UDF base hook generator behavior. |
| amber/src/test/python/core/storage/runnables/test_input_port_materialization_reader_runnable.py | Adds coverage for tuple replay batching/filtering, Start/EndChannel bracketing, stop handling, and error logging semantics. |
| amber/src/test/python/core/storage/model/test_virtual_document.py | New tests pin VirtualDocument default NotImplemented behaviors and abstract-method contract. |
| amber/src/test/python/core/models/test_tuple.py | Adds coverage for BINARY pickle-sentinel round-trip, LARGE_BINARY serialization, schema casting edge cases, and schema validation error messaging. |
| amber/src/test/python/core/architecture/packaging/test_input_manager.py | New tests cover InputManager PortIdentity defaulting, reader thread setup/starting behavior, payload processing, and port completion semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What changes were proposed in this PR?
Extends three pyamber suites and adds two new test files. No source changes.
core/storage/runnables/input_port_materialization_reader_runnable.py(~83% covered): extended over the uncovered branches.core/architecture/packaging/input_manager.py(~88% covered, no dedicated test): new test file.core/models/tuple.py(~95% covered) andpytexera/udf/udf_operator.py(~94% covered): extended.core/storage/model/virtual_document.py(~74% covered, no dedicated test): new test file.Tests are hermetic and deterministic — no real sleeps, nothing left running.
Any related issues, documentation, discussions?
Closes #7017.
How was this PR tested?
python -m pytestover the five files -> 187 passed. (TestTuple::test_hashis deselected locally: it fails identically on unmodifiedmainunder Windows becausetuple.pycallsdatetime.timestamp(), which raisesOSError [Errno 22]there; it passes on the Linux CI runners.)ruff format --check+ruff checkclean.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8 [1M context])