test(pyamber): cover the python worker entry point - #8050
Open
aglinxinyuan wants to merge 1 commit into
Open
Conversation
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8050 +/- ##
============================================
+ Coverage 93.41% 93.43% +0.01%
Complexity 4696 4696
============================================
Files 1179 1179
Lines 47713 47713
Branches 5314 5314
============================================
+ Hits 44573 44580 +7
+ Misses 1698 1691 -7
Partials 1442 1442
*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:
|
Contributor
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 381 | 0.232 | 25,710/36,666/36,666 us | 🔴 +22.8% / 🔴 +164.9% |
| ⚪ | bs=100 sw=10 sl=64 | 812 | 0.496 | 119,088/167,242/167,242 us | ⚪ within ±5% / 🔴 +78.5% |
| ⚪ | bs=1000 sw=10 sl=64 | 956 | 0.583 | 1,042,235/1,113,594/1,113,594 us | ⚪ within ±5% / 🔴 +23.3% |
Baseline details
Latest main b01b11f from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 381 tuples/sec | 440 tuples/sec | 894.86 tuples/sec | -13.4% | -57.4% |
| bs=10 sw=10 sl=64 | MB/s | 0.232 MB/s | 0.268 MB/s | 0.546 MB/s | -13.4% | -57.5% |
| bs=10 sw=10 sl=64 | p50 | 25,710 us | 20,936 us | 11,139 us | +22.8% | +130.8% |
| bs=10 sw=10 sl=64 | p95 | 36,666 us | 32,305 us | 13,843 us | +13.5% | +164.9% |
| bs=10 sw=10 sl=64 | p99 | 36,666 us | 32,305 us | 16,839 us | +13.5% | +117.7% |
| bs=100 sw=10 sl=64 | throughput | 812 tuples/sec | 832 tuples/sec | 1,166 tuples/sec | -2.4% | -30.3% |
| bs=100 sw=10 sl=64 | MB/s | 0.496 MB/s | 0.508 MB/s | 0.711 MB/s | -2.4% | -30.3% |
| bs=100 sw=10 sl=64 | p50 | 119,088 us | 115,920 us | 87,509 us | +2.7% | +36.1% |
| bs=100 sw=10 sl=64 | p95 | 167,242 us | 159,945 us | 93,675 us | +4.6% | +78.5% |
| bs=100 sw=10 sl=64 | p99 | 167,242 us | 159,945 us | 102,153 us | +4.6% | +63.7% |
| bs=1000 sw=10 sl=64 | throughput | 956 tuples/sec | 971 tuples/sec | 1,198 tuples/sec | -1.5% | -20.2% |
| bs=1000 sw=10 sl=64 | MB/s | 0.583 MB/s | 0.593 MB/s | 0.731 MB/s | -1.7% | -20.3% |
| bs=1000 sw=10 sl=64 | p50 | 1,042,235 us | 1,029,828 us | 859,766 us | +1.2% | +21.2% |
| bs=1000 sw=10 sl=64 | p95 | 1,113,594 us | 1,094,755 us | 902,897 us | +1.7% | +23.3% |
| bs=1000 sw=10 sl=64 | p99 | 1,113,594 us | 1,094,755 us | 937,957 us | +1.7% | +18.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,525.45,200,128000,381,0.232,25709.90,36665.53,36665.53
1,100,10,64,20,2462.41,2000,1280000,812,0.496,119088.18,167241.90,167241.90
2,1000,10,64,20,20924.20,20000,12800000,956,0.583,1042234.96,1113594.47,1113594.47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
test_run_python_worker.pygoes from 27 tests to 42, covering the worker entry point's configuration-failure paths.texera_run_python_worker.pyreaches 100% on both lines and branches. +7 fully-covered lines today, +8 and +3 arms after #8040 — line 155 is a partial that the current branch-less report already counts covered, because it executes at import.The uncovered set was the argument-parsing failures (26–28), the loguru level configuration (35), and the missing-dependency and R_HOME paths (48, 51, 155–156). These are what run when the worker starts with a malformed or incomplete configuration, so a regression there surfaces as a worker that fails to start with an unhelpful message.
One correction to the assessment worth recording: line 143, the R_HOME guard, was already at 2/2 — it was not part of the gap.
Verification
Two reviewers returned nine findings and reported thirteen surviving mutants against the first draft. All thirteen were independently reproduced on a pristine tree before being fixed, and all thirteen now die.
39 mutations in the final table: 38 killed, 1 equivalent, 0 real survivors. The equivalent one is
frozensettosetforEXPECTED_CONFIG_KEYS— reported rather than omitted.The repair also confirmed something worth stating about the measurement itself:
pytest'simportlibimport mode re-executes this module per test, and there is exactly one<class filename="texera_run_python_worker.py">entry in every report, on both sides and in the full-suite run. So the fresh execs attribute to the same source path rather than splitting the coverage entry — checked rather than assumed.Measured from
amber/with an identical single-spec test-path scope on both sides, both with and without--cov-branch(the no-branch figure measured directly, not derived), per-linehitsandcondition-coverageread out ofcoverage.xmlrather than from the summary percentage.Full pyamber suite:
5 failed, 1174 passed, 7 errorsagainst main's1159 passed. Failure sets sorted and diffed — identical by identity, 12 entries.ruff checkandruff format --checkpass on CI's exact scope.No production file is touched;
git diff -- 'amber/src/main/*'is empty.Any related issues, documentation, discussions?
Closes #8046
How was this PR tested?
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)