Repository navigation
test(amber): cover PveManager system-package resolution and package deletion - #8036
Conversation
Automated Reviewer SuggestionsBased on the
|
✅ No material benchmark regressions detected🟢 0 better · 🔴 0 worse · ⚪ 15 noise (<±5%) · 0 without baseline
Baseline detailsLatest main
Raw CSVconfig_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,499.06,200,128000,401,0.245,23894.26,36287.58,36287.58
1,100,10,64,20,2463.83,2000,1280000,812,0.495,121946.78,144647.98,144647.98
2,1000,10,64,20,21407.47,20000,12800000,934,0.570,1064392.39,1137046.36,1137046.36 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8036 +/- ##
=========================================
Coverage 93.33% 93.34%
+ Complexity 4692 4688 -4
=========================================
Files 1179 1179
Lines 47713 47713
Branches 5314 5314
=========================================
+ Hits 44534 44537 +3
+ Misses 1730 1724 -6
- Partials 1449 1452 +3
*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:
|
What changes were proposed in this PR?
Six tests added to
PveResourceSpec, coveringPveManager's error paths. That file already owns this class's tests — 15"PveManager" shouldblocks — so this extends it rather than adding a second spec.+7 fully-covered lines and +7 branch arms. The newly covered lines are the three give-up arms of
resolveSystemPackages(149/151, 170/172, 181/183) and the uninstall-failure arm ofdeletePackages(565) — all plain control flow, nologger.info/debugbodies, so none is a line that looks green locally and dies in CI.These figures are the CI-equivalent projection, not the raw local numbers.
PveResourceSpechas 6 pre-existing Windows-only failures — its fake runner fabricates a POSIX<venv>/bin/pythonwhilePveManagerresolves<venv>/Scripts/python.exe— so the raw local delta is inflated and is deliberately not quoted. The projection was built by applying a throwaway test-file scaffold that makes the runner platform-aware, measuring both sides with it applied byte-identically, then reverting it.On the absolute endpoints: two independent measurements agree on +7 but differ by 3 on the endpoints (198 → 205 vs 195 → 202). The delta is solid and reproduced three times; the endpoint is the softer number. I would rather say that than publish a figure with more confidence than it has.
What the reviewers found
This bundle went through a mutation audit and then a separate vacuity review, and each found real defects the other could not.
The mutation audit's most serious catch: the resolver tests recorded what the runner was handed but asserted only its length, never what ran. Retargeting the install from the throwaway venv to
PythonUtils.getPythonExecutablewas byte-identical to baseline — meaningresolveSystemPackageswould pip-installrequirements.txtinto the machine's system Python and report that interpreter's package set as "the system set", with the test named "give up without attempting the install" unable to tell the difference.The vacuity review then found three things a mutation audit structurally cannot:
Comparator.reverseOrder()fornaturalOrder()makes the delete hit the non-empty parent first, throw, and get swallowed by the block's owncatch— the entire temp tree leaks, and the suite stayed green..map(_.trim).filter(…)for.filter(…).map(_.trim)survived, because every fixture line landed the same way either way. Fixed by indenting the## FIXMEfixture line two spaces — it is a comment only after trimming, so it is the one line that separates the two orders.--constraintfile, and the word appeared in the spec only inside comments. No assertion referenced the flag, the file, or its contents. Two mutants were therefore unkillable — including one that keeps package names but drops every version pin, leaving pip free to resolve anypyarrow.All are now killed by a named test. The new
--constrainttest adds zero coverage — its path was already covered — and is included purely as a mutation-strength test; it is the sole killer of the constraint-file mutant.Verification
Four load-bearing mutants were re-run against the final content, one at a time, each with a uniqueness-asserted anchor, reverted from a scratch snapshot, with the production diff verified empty and an md5 match before every subsequent compile. All four killed, each by a named test.
One published mutation row was discarded rather than reported: applied exactly as written it failed to compile (
forward reference to value collected), and a compile-only mutant proves nothing. It was replaced with a semantically equivalent hoisted variant that does compile and does die.No regression. The 6 pre-existing failures are identical in name on
mainand on this branch, not merely equal in count. All six new tests pass on Windows unscaffolded.Deliberately not included
resolveSystemPackagesfails open and this PR does not pin that as correct. All three give-up arms returnSeq.empty, and callers degrade silently:systemPackageNamesbecomes empty, so a user may install or delete any package including one the Python workers depend on, and the--constraintfile becomes empty, so user installs are no longer pinned. The tests assert the giving up — that the next command never runs, that a partial freeze is discarded — which is unambiguously right. No assertion blesses "empty set" as the correct answer for the application, and the spec says so. Fixing it is a production change.Two survivor probes are recorded rather than pinned: the three
logger.errorcalls can all be deleted with the suite outcome-identical (asserting on log lines means attaching an appender inside a shared, strictly-serial JVM, and those lines stay Codecov-missed regardless because of the scalalogging guard arm), and the cleanupfinallyblock can be replaced with()— those lines already count as hits through try/finally bytecode duplication, so pinning them is worth zero.systemPackages/systemPackageNames/systemConstraintFileare JVM-lifetime lazy vals, so resolution can be driven exactly once per JVM and the publicgetSystemPackagescan never be exercised against a failing runner. The tests reach the private method reflectively; a rename yieldsNoSuchMethodException, i.e. a test error rather than a false pass, which was verified.No production file is touched.
Any related issues, documentation, discussions?
Closes #8034
How was this PR tested?
The 6 failures are the pre-existing Windows-only ones described above and are present on
mainunchanged; under the CI-equivalence scaffold the same scope reportssucceeded 57, failed 0.WorkflowExecutionService/Test/scalafmtCheckandWorkflowExecutionService/Test/scalafix --checkboth pass.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)