Skip to content

test(pyamber): cover the statistics and pause managers - #8049

Merged
aglinxinyuan merged 2 commits into
apache:mainfrom
aglinxinyuan:cov/pyamber-managers
Aug 28, 2026
Merged

test(pyamber): cover the statistics and pause managers#8049
aglinxinyuan merged 2 commits into
apache:mainfrom
aglinxinyuan:cov/pyamber-managers

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Two manager specs extended, 19 tests to 27.

File Codecov fully-covered Branch arms
statistics_manager.py 41/45 → 45/45 12/14 → 14/14
pause_manager.py 42/45 → 45/45 12/14 → 14/14

+7 fully-covered lines and +4 branch arms. Both files reach 100% on lines and branches.

statistics_manager.py's gap was 94: 50% (1/2), 95: MISS, 101: 50% (1/2), 102: MISS — the arms deciding whether an input or output statistics update is recorded at all. pause_manager.py's was the channel pause/resume paths, including both change_state=False variants and the global-pause queue cycle.

Two files were dropped from this bundle on measurement: state_manager.py (1 line) and linked_blocking_multi_queue.py, whose four partial lines did not survive scrutiny despite its 78 branch arms. core/util/customized_queue/inner.py sits in the same package and shows 2 partials plus 5 missed lines, but it is vendored third-party code and was refused rather than counted.

Verification

Two reviewers returned eleven findings — the most of any bundle in this batch. The builder had reported survivors: [], which the reviewers showed was materially wrong.

46 mutations were run one at a time against the final tree; 44 die, and 15 of those die at exactly one test each. The two that survive are reported rather than dropped, both genuinely equivalent:

  • Exchanging the .add(channel_id) and disable(channel_id) statements inside pause_input_channel — both statements are individually pinned by separate tests, so the order is unobservable.
  • Replacing the guarded remove with discarddiscard is by definition remove if present.

Measured from amber/ with the identical full-suite scope on both sides and --cov-branch passed explicitly, since this branch is on main and amber/pyproject.toml has no [tool.coverage.run] section (verified by reading it: only the three ruff tables and pytest.ini_options exist). Per-line hits and condition-coverage were read out of coverage.xml by a parser script; summary percentages ignored. The before-state was produced by writing the HEAD content of the two test files into the tree from a scratch extraction and restoring the new versions from a scratch snapshot afterwards, sha256-verified. No git restore or git checkout was run on any file.

Full pyamber suite: 5 failed, 1167 passed, 7 errors against main's 1159 passed. Failure sets sorted and diffed — identical by identity, 12 entries. ruff check and ruff format --check pass on CI's exact scope.

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

Any related issues, documentation, discussions?

Closes #8045

How was this PR tested?

cd amber && python -m pytest -m "not integration" -q src/test/python/core/architecture/managers
27 passed

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 27, 2026 11:46

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

@codecov-commenter

codecov-commenter commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.42%. Comparing base (b01b11f) to head (4ffe6b8).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8049   +/-   ##
=========================================
  Coverage     93.41%   93.42%           
  Complexity     4696     4696           
=========================================
  Files          1179     1179           
  Lines         47713    47713           
  Branches       5314     5314           
=========================================
+ Hits          44573    44576    +3     
+ Misses         1698     1695    -3     
  Partials       1442     1442           
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from bc43983
agent-service 99.32% <ø> (ø) Carriedforward from bc43983
amber 89.60% <ø> (ø) Carriedforward from bc43983
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from bc43983
config-service 86.73% <ø> (ø) Carriedforward from bc43983
file-service 86.70% <ø> (ø) Carriedforward from bc43983
frontend 95.89% <ø> (ø) Carriedforward from bc43983
notebook-migration-service 79.31% <ø> (ø) Carriedforward from bc43983
pyamber 97.85% <ø> (+0.06%) ⬆️
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from bc43983

*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

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main b01b11f 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 713 0.435 14,600/16,394/16,394 us 🟢 -30.5% / 🔴 +30.6%
bs=100 sw=10 sl=64 1,652 1.008 56,841/91,322/91,322 us ⚪ within ±5% / 🟢 +42.7%
🟢 bs=1000 sw=10 sl=64 2,042 1.247 483,624/559,252/559,252 us 🟢 -7.9% / 🟢 +72.2%
Baseline details

Latest main b01b11f from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 713 tuples/sec 707 tuples/sec 893.99 tuples/sec +0.8% -20.2%
bs=10 sw=10 sl=64 MB/s 0.435 MB/s 0.432 MB/s 0.546 MB/s +0.7% -20.3%
bs=10 sw=10 sl=64 p50 14,600 us 12,830 us 11,176 us +13.8% +30.6%
bs=10 sw=10 sl=64 p95 16,394 us 23,605 us 14,009 us -30.5% +17.0%
bs=10 sw=10 sl=64 p99 16,394 us 23,605 us 16,898 us -30.5% -3.0%
bs=100 sw=10 sl=64 throughput 1,652 tuples/sec 1,588 tuples/sec 1,157 tuples/sec +4.0% +42.7%
bs=100 sw=10 sl=64 MB/s 1.008 MB/s 0.969 MB/s 0.706 MB/s +4.0% +42.7%
bs=100 sw=10 sl=64 p50 56,841 us 58,354 us 88,763 us -2.6% -36.0%
bs=100 sw=10 sl=64 p95 91,322 us 87,705 us 95,096 us +4.1% -4.0%
bs=100 sw=10 sl=64 p99 91,322 us 87,705 us 102,854 us +4.1% -11.2%
bs=1000 sw=10 sl=64 throughput 2,042 tuples/sec 2,026 tuples/sec 1,187 tuples/sec +0.8% +72.1%
bs=1000 sw=10 sl=64 MB/s 1.247 MB/s 1.236 MB/s 0.724 MB/s +0.9% +72.2%
bs=1000 sw=10 sl=64 p50 483,624 us 486,026 us 874,968 us -0.5% -44.7%
bs=1000 sw=10 sl=64 p95 559,252 us 606,959 us 917,815 us -7.9% -39.1%
bs=1000 sw=10 sl=64 p99 559,252 us 606,959 us 949,868 us -7.9% -41.1%
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,280.51,200,128000,713,0.435,14600.17,16394.40,16394.40
1,100,10,64,20,1210.62,2000,1280000,1652,1.008,56840.63,91322.18,91322.18
2,1000,10,64,20,9792.73,20000,12800000,2042,1.247,483624.46,559251.83,559251.83

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread amber/src/test/python/core/architecture/managers/test_pause_manager.py Outdated

@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

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Xinyuan Lin <xinyual3@uci.edu>
@aglinxinyuan
aglinxinyuan enabled auto-merge August 28, 2026 02:41
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Aug 28, 2026
Merged via the queue into apache:main with commit 1d47f1d Aug 28, 2026
23 checks passed
@aglinxinyuan
aglinxinyuan deleted the cov/pyamber-managers branch August 28, 2026 03:20
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 the pyamber statistics and pause managers

4 participants