test(amber): pin the previous run's storage-registry clean-up - #7712
test(amber): pin the previous run's storage-registry clean-up#7712aglinxinyuan wants to merge 2 commits into
Conversation
Automated Reviewer SuggestionsBased on the
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 379 | 0.231 | 25,658/31,488/31,488 us | 🔴 +9.2% / 🔴 +103.2% |
| 🔴 | bs=100 sw=10 sl=64 | 799 | 0.488 | 122,064/177,490/177,490 us | 🔴 +36.3% / 🔴 +68.1% |
| ⚪ | bs=1000 sw=10 sl=64 | 993 | 0.606 | 1,012,737/1,087,122/1,087,122 us | ⚪ within ±5% / 🔴 +7.4% |
Baseline details
Latest main 1c4662b from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 379 tuples/sec | 398 tuples/sec | 784.16 tuples/sec | -4.8% | -51.7% |
| bs=10 sw=10 sl=64 | MB/s | 0.231 MB/s | 0.243 MB/s | 0.479 MB/s | -4.9% | -51.7% |
| bs=10 sw=10 sl=64 | p50 | 25,658 us | 23,487 us | 12,626 us | +9.2% | +103.2% |
| bs=10 sw=10 sl=64 | p95 | 31,488 us | 34,454 us | 16,169 us | -8.6% | +94.7% |
| bs=10 sw=10 sl=64 | p99 | 31,488 us | 34,454 us | 18,986 us | -8.6% | +65.8% |
| bs=100 sw=10 sl=64 | throughput | 799 tuples/sec | 890 tuples/sec | 1,023 tuples/sec | -10.2% | -21.9% |
| bs=100 sw=10 sl=64 | MB/s | 0.488 MB/s | 0.543 MB/s | 0.625 MB/s | -10.1% | -21.9% |
| bs=100 sw=10 sl=64 | p50 | 122,064 us | 110,925 us | 99,185 us | +10.0% | +23.1% |
| bs=100 sw=10 sl=64 | p95 | 177,490 us | 130,261 us | 105,616 us | +36.3% | +68.1% |
| bs=100 sw=10 sl=64 | p99 | 177,490 us | 130,261 us | 113,681 us | +36.3% | +56.1% |
| bs=1000 sw=10 sl=64 | throughput | 993 tuples/sec | 1,020 tuples/sec | 1,057 tuples/sec | -2.6% | -6.0% |
| bs=1000 sw=10 sl=64 | MB/s | 0.606 MB/s | 0.623 MB/s | 0.645 MB/s | -2.7% | -6.0% |
| bs=1000 sw=10 sl=64 | p50 | 1,012,737 us | 976,278 us | 965,435 us | +3.7% | +4.9% |
| bs=1000 sw=10 sl=64 | p95 | 1,087,122 us | 1,110,122 us | 1,012,135 us | -2.1% | +7.4% |
| bs=1000 sw=10 sl=64 | p99 | 1,087,122 us | 1,110,122 us | 1,042,088 us | -2.1% | +4.3% |
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,527.44,200,128000,379,0.231,25658.12,31488.35,31488.35
1,100,10,64,20,2503.42,2000,1280000,799,0.488,122064.26,177489.51,177489.51
2,1000,10,64,20,20141.28,20000,12800000,993,0.606,1012736.54,1087121.59,1087121.59
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7712 +/- ##
============================================
+ Coverage 90.93% 90.95% +0.01%
- Complexity 4450 4452 +2
============================================
Files 1174 1174
Lines 47139 47139
Branches 5284 5284
============================================
+ Hits 42867 42873 +6
+ Misses 2579 2574 -5
+ Partials 1693 1692 -1
*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?
clearExecutionResources-- the method that wipes the previous run's storage registry before a new execution starts -- was entered by no test. It was unreachable only by accident:SyncExecutionResourceSpec:145-151documents parking its fixtures under a second computing unit precisely to avoid this path, so the recipe existed and merely needed inverting.Tests 8 -> 10. Lines 76/96 (79.2%) -> 84/96 (87.5%), branches 9/14, measured with only this spec running.
The new test drives the real
initExecutionServicepath underMockTexeraDB(zonky EmbeddedPostgres, no Docker), steeringexecuteWorkflow()into a compile failure so it returns before any runtime is created, and asserts the registry rows for the previous execution are deleted -- scoped to that workflow and that computing unit, for the latest execution only.This PR is small on coverage and I would rather say so than dress it up: 8 lines. What makes it worth landing is the contract, which is currently untested and easy to break silently, and the two defects the verification turned up.
Verification
Review proposed 20 mutations. Every one survived the baseline suite (one exception noted below). 19 are now killed, each verified red on the named test; one is recorded as unpinnable.
The recurring cause was a degenerate fixture -- every id was the same number:
WID.eq(cuid).and(CUID.eq(wid))transposedwid == uid == cuid == 9411made the mutated SQL byte-identicalWIDlegSome(executions.max)->.min.eq->.leon execution idreq.computingUnitId-> the service's own fieldexecutionName/engineVersionat the insert siteregisterCleanUpOnStateChangeFixed by giving every domain its own literal (wid 9411, otherWid 9412, uid 9413, cuid 9414, otherCuid 9415), seeding a second workflow on the same unit, an older execution below the one under test, and reading the newly inserted row back.
Two defects the verification exposed
The test was cementing a bug. Guarding the clean-up on the previous execution being terminal -- a defensible production fix -- killed the pre-repair test, because the fixture persisted a non-terminal previous execution and asserted it was wiped. That test would have blocked the fix. The fixture now uses a terminal previous execution, so the guard can be added without this spec fighting it.
The suite was doing a real S3 delete.
clearExecutionResourcescallsLargeBinaryManager.deleteByExecution, which reachesS3StorageClientagainsthttp://localhost:9000. WithSERIALids the fixture's execution got eid 1 --LargeBinaryManager'sDEFAULT_EXECUTION_IDsentinel -- so on a dev box runningbin/local-dev.sh upthe test recursively deletedobjects/1/in MinIO. The baseline log shows it. Explicit non-1 eids fix the blast radius; the call itself still attempts a connection (now to a nonexistent prefix), which cannot be avoided without a production seam.One mutation is left alive
Deleting line 406 (
LargeBinaryManager.deleteByExecution) survives, and is recorded in the spec header rather than counted as covered. The injectable overload isprivate[util], so the call site cannot use it, and asserting the S3 effect would mean asserting the ambient environment.Deliberately not included
The fault-tolerance block: gated on
ApplicationConfig.faultToleranceLogRootFolder, avalin a Scalaobjectread at object-init with no seam, whichApplicationConfigSpec:90asserts isNone. The replay block: its values are consumed only pastcreateAmberRuntime, which the compile failure guarantees is never reached, so it is pinnable only by reflecting into a private field.Also reported, not tested:
lastCompletedLogicalPlan(line 163) is a write-only var -- a repo-wide grep finds only its declaration and its single write, no readers.Worth recording for future coverage work on this file: JaCoCo's
SyntheticFilterdrops Scala's$anonfun$methods, so every lambda body here -- the lifecycle cleanup callback, the completion diff-handler, the errorHandler, both cleanup loops, the replayforeach-- is invisible to the coverage number. Roughly 30 lines where a test moves it by exactly zero.No production file is touched.
Any related issues, documentation, discussions?
Closes #7711
How was this PR tested?
Test/scalafmtCheckandTest/scalafix --checkboth pass.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)