Skip to content

test(pyamber): extend IO, packaging and storage-model coverage - #7019

Open
aglinxinyuan wants to merge 1 commit into
apache:mainfrom
aglinxinyuan:test-pyamber-io-cov
Open

test(pyamber): extend IO, packaging and storage-model coverage#7019
aglinxinyuan wants to merge 1 commit into
apache:mainfrom
aglinxinyuan:test-pyamber-io-cov

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

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) and pytexera/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 pytest over the five files -> 187 passed. (TestTuple::test_hash is deselected locally: it fails identically on unmodified main under Windows because tuple.py calls datetime.timestamp(), which raises OSError [Errno 22] there; it passes on the Linux CI runners.) ruff format --check + ruff check clean.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.8 [1M context])

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.
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @eugenegujing, @carloea2
    You can notify them by mentioning @eugenegujing, @carloea2 in a comment.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 0 better · 🔴 6 worse · ⚪ 9 noise (<±5%) · 0 without baseline

Compared against main ab58d47 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

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-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.18%. Comparing base (469e8f0) to head (1bcc3f8).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

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              
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 469e8f0
agent-service 76.76% <ø> (ø) Carriedforward from 469e8f0
amber 72.20% <ø> (ø) Carriedforward from 469e8f0
computing-unit-managing-service 20.49% <ø> (ø) Carriedforward from 469e8f0
config-service 66.66% <ø> (ø) Carriedforward from 469e8f0
file-service 67.21% <ø> (ø) Carriedforward from 469e8f0
frontend 82.99% <ø> (ø) Carriedforward from 469e8f0
notebook-migration-service 78.94% <ø> (ø) Carriedforward from 469e8f0
pyamber 97.38% <ø> (+1.99%) ⬆️
workflow-compiling-service 26.31% <ø> (ø) Carriedforward from 469e8f0

*This pull request uses carry forward flags. Click here to find out more.

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py to cover _UiParameterSupport parsing failures, open-wrapper edge cases, and base-class default hook generator behavior.
  • Extended test_input_port_materialization_reader_runnable.py to cover tuple replay/partition filtering, channel bracketing ECMs, stop behavior, and error logging behavior.
  • Added dedicated new test files for InputManager and VirtualDocument default/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.

@mengw15 mengw15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jul 29, 2026
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend pyamber IO, packaging and storage-model coverage

4 participants