Skip to content

test(pyamber): close the schema, table, proxy and network-sender gaps - #8067

Open
aglinxinyuan wants to merge 1 commit into
apache:mainfrom
aglinxinyuan:cov/pyamber-models-and-proxy
Open

test(pyamber): close the schema, table, proxy and network-sender gaps#8067
aglinxinyuan wants to merge 1 commit into
apache:mainfrom
aglinxinyuan:cov/pyamber-models-and-proxy

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Seven pyamber files, five existing specs extended and two new ones added. +15 fully-covered lines; six of the seven files reach 100%.

File Missed before After
handlers/control/open_executor_handler.py 2 (67%) 0 — 100%
models/schema/schema.py 3 (94%) 0 — 100%
models/schema/attribute_type.py 2 (96%) 0 — 100%
models/table.py 2 (95%) 0 — 100%
proxy/proxy_client.py 2 (94%) 0 — 100%
runnables/network_sender.py 2 (96%) 0 — 100%
storage/iceberg/iceberg_utils.py 4 local / 2 CI 2 left

No file here is worth a PR alone — each carries two or three lines. The bundle total is the point, and it is stated that way rather than dressed up per file.

iceberg_utils.py closes lines 239 and 275; its remaining 302–303 are already green in CI and worth zero. The local figure of 4 missed is a local-environment artefact, which is why the honest CI-equivalent gain is +15 and not +17.

Tests across the seven files go 37 → 89.

A measurement trap worth recording

This machine cannot run the Iceberg-backed tests — the postgres texera role cannot read iceberg_tables — so a raw local coverage run under-reports. An earlier assessment of one of these files measured 12 missed lines locally where Codecov showed 2, wrong by 6×. Every target here was sized from Codecov and the local numbers were used only for the delta, never for the ceiling.

Dead production code found, and deliberately not pinned

attribute_type.py:96-97 normalises a trailing Z before calling datetime.fromisoformat. Deleting the whole block leaves the suite byte-identical. That is not a coverage gap — fromisoformat has accepted Z since Python 3.11, and the CI matrix is 3.11/3.12/3.13, so the block is dead on every interpreter the project runs. A 10-case differential probe confirmed it.

No test was written to pin it. The test that had been named after that branch was renamed and annotated, so nothing in the suite claims to constrain a branch that cannot be reached.

Verification

27 mutations, 26 killed, 1 equivalent — the equivalent one being the dead block above. Each was applied one at a time against a tree verified hash-equal to a snapshot, reverted from that snapshot rather than from git.

Two adversarial reviewers returned nine findings against the first draft; all repaired, adding six further tests.

Measured with --cov=src/main/python under the exact marker filter CI uses (-m "not integration"), no name filter, identical on both sides. The before-state restored each tracked spec by exact single file path via git show HEAD:<path> and moved the two new specs aside; all seven were then restored from a scratch snapshot and md5-verified.

Full pyamber suite: 5 failed, 1269 passed, 7 errors, with the FAILED/ERROR set identical by identity to main's 12 entries — no regression. ruff check and ruff format --check pass on CI's exact scope (src/main/python src/test/python). Both new spec files carry the Apache licence header.

No production file is touched; git diff -- 'amber/src/main/*' is empty.

Any related issues, documentation, discussions?

Closes #8065

How was this PR tested?

cd amber && python -m pytest -m "not integration" -q src/test/python/core/models src/test/python/core/proxy src/test/python/core/runnables/test_network_sender.py src/test/python/core/architecture/handlers/control/test_open_executor_handler.py src/test/python/core/storage/iceberg/test_iceberg_utils_catalog.py
89 passed, 1 warning in 1.73s

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

Generated-by: Claude Code (Opus 5)

Copilot AI lite review requested due to automatic review settings August 28, 2026 04:26

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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: @kunwp1, @Yicong-Huang
    You can notify them by mentioning @kunwp1, @Yicong-Huang in a comment.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.54%. Comparing base (bdc6d2a) to head (cc41d24).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8067      +/-   ##
============================================
+ Coverage     93.51%   93.54%   +0.03%     
  Complexity     4709     4709              
============================================
  Files          1181     1181              
  Lines         47809    47809              
  Branches       5327     5327              
============================================
+ Hits          44708    44725      +17     
+ Misses         1663     1646      -17     
  Partials       1438     1438              
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from bdc6d2a
agent-service 99.32% <ø> (ø) Carriedforward from bdc6d2a
amber 89.59% <ø> (ø) Carriedforward from bdc6d2a
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from bdc6d2a
config-service 86.73% <ø> (ø) Carriedforward from bdc6d2a
file-service 87.89% <ø> (ø) Carriedforward from bdc6d2a
frontend 95.92% <ø> (ø) Carriedforward from bdc6d2a
notebook-migration-service 79.31% <ø> (ø) Carriedforward from bdc6d2a
pyamber 98.87% <ø> (+0.36%) ⬆️
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from bdc6d2a

*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.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main bdc6d2a 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 538 0.328 18,650/22,178/22,178 us 🔴 +23.2% / 🔴 +66.9%
🔴 bs=100 sw=10 sl=64 1,171 0.715 85,477/101,469/101,469 us 🟢 -20.8% / 🔴 +6.7%
🔴 bs=1000 sw=10 sl=64 1,401 0.855 712,629/797,783/797,783 us 🔴 +8.4% / 🟢 -18.6%
Baseline details

Latest main bdc6d2a from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 538 tuples/sec 570 tuples/sec 893.99 tuples/sec -5.6% -39.8%
bs=10 sw=10 sl=64 MB/s 0.328 MB/s 0.348 MB/s 0.546 MB/s -5.7% -39.9%
bs=10 sw=10 sl=64 p50 18,650 us 15,132 us 11,176 us +23.2% +66.9%
bs=10 sw=10 sl=64 p95 22,178 us 28,561 us 14,009 us -22.3% +58.3%
bs=10 sw=10 sl=64 p99 22,178 us 28,561 us 16,898 us -22.3% +31.2%
bs=100 sw=10 sl=64 throughput 1,171 tuples/sec 1,127 tuples/sec 1,157 tuples/sec +3.9% +1.2%
bs=100 sw=10 sl=64 MB/s 0.715 MB/s 0.688 MB/s 0.706 MB/s +3.9% +1.2%
bs=100 sw=10 sl=64 p50 85,477 us 80,485 us 88,763 us +6.2% -3.7%
bs=100 sw=10 sl=64 p95 101,469 us 128,196 us 95,096 us -20.8% +6.7%
bs=100 sw=10 sl=64 p99 101,469 us 128,196 us 102,854 us -20.8% -1.3%
bs=1000 sw=10 sl=64 throughput 1,401 tuples/sec 1,443 tuples/sec 1,187 tuples/sec -2.9% +18.1%
bs=1000 sw=10 sl=64 MB/s 0.855 MB/s 0.881 MB/s 0.724 MB/s -3.0% +18.0%
bs=1000 sw=10 sl=64 p50 712,629 us 691,280 us 874,968 us +3.1% -18.6%
bs=1000 sw=10 sl=64 p95 797,783 us 735,719 us 917,815 us +8.4% -13.1%
bs=1000 sw=10 sl=64 p99 797,783 us 735,719 us 949,868 us +8.4% -16.0%
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,371.77,200,128000,538,0.328,18650.25,22178.00,22178.00
1,100,10,64,20,1707.48,2000,1280000,1171,0.715,85476.53,101468.94,101468.94
2,1000,10,64,20,14276.97,20000,12800000,1401,0.855,712629.22,797782.97,797782.97

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.

Add unit test coverage for seven small pyamber gaps

3 participants