You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "aglinxinyuan (via GitHub)" <gi...@apache.org> on 2026/08/17 06:49:21 UTC
[PR] test(amber): cover the materialization reader thread and the executor initializer [texera]
aglinxinyuan opened a new pull request, #7729:
URL: https://github.com/apache/texera/pull/7729
### What changes were proposed in this PR?
Two worker-side files had no spec. Adds one each, 14 tests total.
Measured by running the full amber unit suite under the CI environment (`STORAGE_ICEBERG_CATALOG_TYPE=postgres`, `TEXERA_SERVICE_LOG_LEVEL=WARN`) before and after, so these are directly comparable to the reported figures — the baseline reproduced all of them exactly:
| File | Before | After |
|---|---|---|
| `InputPortMaterializationReaderThread.scala` | 52/63 (82.5%), 7 missed + 4 partial | **62/63 (98.4%)**, 0 missed |
| `DataProcessorRPCHandlerInitializer.scala` | 5/15 (33.3%), 8 missed + 2 partial | **8/15 (53.3%)** |
Instruction coverage: reader thread 85.1% -> **100.0%**; initializer 81.0% -> 89.1%. Run on their own, the two specs take the reader thread to 63/63 lines and 343/343 instructions.
**This is +13 lines, and I would rather state that plainly than dress it up.** What earns the PR is the pinning rather than the count: the reader thread's replay ordering, batching, partition filtering and failure wrapping were all unverified, and eight distinct mutants now die on them.
### A third target was assessed and rejected
`ClientActor.scala` (65.2%) is **saturated, not undertested**, and roughly 190 lines of test bought exactly 1 line, 1 branch and 3 instructions — so that work was dropped rather than shipped. Its 7 remaining misses are the companion object's own `<init>`, four `case class` declaration lines carrying 112 of the file's 176 branches inside scalac-generated `equals`/`hashCode`/`productElement` (all with zero covered branches), and two structural lines. The cause is that the e2e specs are not tagged `@IntegrationTest`, so they run in the coverage job and already drive a real Coordinator through a real `ClientActor`.
### Verification
12 mutations, **11 killed, 1 recorded equivalent**, each applied one at a time with the production file diffed after every revert and the failing test read by name.
| Mutation | Killed by |
|---|---|
| exchange `workerIdx` and `workerCount` | builds the named class from the descriptor, worker index and worker count |
| exchange `OpExecWithCode`'s code and language fields | sends the code to the Java compiler, surfacing its diagnostics |
| install an executor only when none is installed | replaces an executor that was already installed |
| empty init info returns `null` instead of throwing | rejects an empty `OpExecInitInfo` instead of installing a null executor |
| exchange START and END channel alignments | brackets the replay and marks itself finished |
| exchange channel sender and receiver | sends every message from a URI-derived sender, numbered from zero |
| `buffer.size >= batchSize` -> `>` | cuts a full batch as soon as the buffer reaches the transfer batch size |
| drop the receiver check in the partitioner filter | drops tuples routed to another worker; splits a hash-shuffled link |
| drop the cause when wrapping a storage failure | wraps a storage failure in a `RuntimeException` that keeps the cause |
| `isFinished.set(true)` -> `false` | two tests |
| shift every replayed loop counter by one | replays states ahead of tuples, carrying each row's loop envelope |
**The equivalent mutant:** flipping the trailing-flush guard survives. `if (buffer.nonEmpty) flush()` is immediately followed by `emitECM(METHOD_END_CHANNEL, ...)`, whose first statement is `flush()`, and `flush()` itself returns early on an empty buffer. Both legs enqueue the same `DataFrame`, in the same position, with the same sequence number. No test can distinguish them — the guard is dead weight.
**One process failure worth recording**, because it is the kind that silently corrupts a mutation table: the partition-filter mutation was first spelled `.nonEmpty`, which collided with a nearby `buffer.nonEmpty`. The revert's exactly-once assertion correctly refused to fire and left the mutant applied, contaminating the four runs after it — their tables showed the earlier mutation's tests failing alongside the real kill. The `git diff` guard caught it; the file was restored, the mutation respelled as `.exists(_ => true)`, and those runs redone. The table above is the clean run.
### Deliberately not included
- `newExecFromJavaCode` is uncoverable from a unit test: `JavaRuntimeCompilation.compileCode` passes null options to `compiler.getTask(...)`, so system javac uses `java.class.path`, which under sbt (`fork := false`) does not contain workflow-core. A UDF implementing `OperatorExecutor` cannot compile, so the method never returns normally.
- `noOperation` is dead on the Scala path — `NoOperation` is produced and consumed only by the Python worker. The other three `???` members have live coordinator-side call sites but resolve to `???` on a Scala worker; testing them would cement "unimplemented" as a contract.
- Remaining partials are the unreachable kinds: a `lazy val` bitmap and the `MatchError` fall-through of a scalapb sealed oneof.
A possible defect is reported rather than pinned: `InputManager.startInputPortReaderThreads` wraps a start failure as `new RuntimeException(s"Error starting input port materialization reader thread: ${e.getMessage}")`, **dropping the cause** — unlike the reader thread itself, which passes `e`. That discards the stack trace of the real failure.
No production file is touched.
### Any related issues, documentation, discussions?
Closes #7728
### How was this PR tested?
```
STORAGE_ICEBERG_CATALOG_TYPE=postgres sbt "WorkflowExecutionService/testOnly org.apache.texera.amber.engine.architecture.worker.DataProcessorRPCHandlerInitializerSpec org.apache.texera.amber.engine.architecture.worker.managers.InputPortMaterializationReaderThreadSpec"
```
```
[info] Total number of tests run: 14
[info] Tests: succeeded 14, failed 0, canceled 0, ignored 0, pending 0
```
The full amber unit suite is green alongside them (1930 passed). `Test/scalafmtCheck` and `Test/scalafix --check` both pass.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(amber): cover the materialization reader thread and the executor initializer [texera]
Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan merged PR #7729:
URL: https://github.com/apache/texera/pull/7729
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(amber): cover the materialization reader thread and the executor initializer [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7729:
URL: https://github.com/apache/texera/pull/7729#issuecomment-5312838901
<!-- texera-benchmarks-comment -->
## ⚠️ Benchmark changes need a look
🟢 2 better · 🔴 3 worse · ⚪ 10 noise (<±5%) · 0 without baseline
> Compared against main `16ba619` 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](https://apache.github.io/texera/dev/bench/) · [Run](https://github.com/apache/texera/actions/runs/32003187180)
| | config | throughput | MB/s | latency | max Δ latest / 7d |
|---|---|---:|---:|---:|---:|
| 🔴 | bs=10 sw=10 sl=64 | 479 | 0.293 | 22,233/24,999/24,999 us | 🔴 +20.8% / 🔴 +76.1% |
| ⚪ | bs=100 sw=10 sl=64 | 1,188 | 0.725 | 83,060/108,234/108,234 us | ⚪ within ±5% / 🟢 -16.3% |
| ⚪ | bs=1000 sw=10 sl=64 | 1,405 | 0.857 | 715,949/760,485/760,485 us | ⚪ within ±5% / 🟢 +33.0% |
<details><summary>Baseline details</summary>
Latest main `16ba619` from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---:|---:|---:|---:|---:|
| bs=10 sw=10 sl=64 | throughput | 479 tuples/sec | 539 tuples/sec | 784.16 tuples/sec | -11.1% | -38.9% |
| bs=10 sw=10 sl=64 | MB/s | 0.293 MB/s | 0.329 MB/s | 0.479 MB/s | -10.9% | -38.8% |
| bs=10 sw=10 sl=64 | p50 | 22,233 us | 18,411 us | 12,626 us | +20.8% | +76.1% |
| bs=10 sw=10 sl=64 | p95 | 24,999 us | 28,319 us | 16,169 us | -11.7% | +54.6% |
| bs=10 sw=10 sl=64 | p99 | 24,999 us | 28,319 us | 18,986 us | -11.7% | +31.7% |
| bs=100 sw=10 sl=64 | throughput | 1,188 tuples/sec | 1,223 tuples/sec | 1,023 tuples/sec | -2.9% | +16.1% |
| bs=100 sw=10 sl=64 | MB/s | 0.725 MB/s | 0.747 MB/s | 0.625 MB/s | -2.9% | +16.1% |
| bs=100 sw=10 sl=64 | p50 | 83,060 us | 80,330 us | 99,185 us | +3.4% | -16.3% |
| bs=100 sw=10 sl=64 | p95 | 108,234 us | 103,487 us | 105,616 us | +4.6% | +2.5% |
| bs=100 sw=10 sl=64 | p99 | 108,234 us | 103,487 us | 113,681 us | +4.6% | -4.8% |
| bs=1000 sw=10 sl=64 | throughput | 1,405 tuples/sec | 1,400 tuples/sec | 1,057 tuples/sec | +0.4% | +33.0% |
| bs=1000 sw=10 sl=64 | MB/s | 0.857 MB/s | 0.854 MB/s | 0.645 MB/s | +0.4% | +32.9% |
| bs=1000 sw=10 sl=64 | p50 | 715,949 us | 715,241 us | 965,435 us | +0.1% | -25.8% |
| bs=1000 sw=10 sl=64 | p95 | 760,485 us | 769,557 us | 1,012,135 us | -1.2% | -24.9% |
| bs=1000 sw=10 sl=64 | p99 | 760,485 us | 769,557 us | 1,042,088 us | -1.2% | -27.0% |
</details>
<details><summary>Raw CSV</summary>
```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,417.23,200,128000,479,0.293,22233.18,24999.05,24999.05
1,100,10,64,20,1683.54,2000,1280000,1188,0.725,83060.21,108234.17,108234.17
2,1000,10,64,20,14238.88,20000,12800000,1405,0.857,715948.71,760485.23,760485.23
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(amber): cover the materialization reader thread and the executor initializer [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7729:
URL: https://github.com/apache/texera/pull/7729#issuecomment-5312781707
<!-- texera-reviewer-suggestion -->
### Automated Reviewer Suggestions
Based on the `git blame` history of the changed files, we recommend the following reviewers:
- No candidates found from `git blame` history.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(amber): cover the materialization reader thread and the executor initializer [texera]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #7729:
URL: https://github.com/apache/texera/pull/7729#issuecomment-5312897574
## [Codecov](https://app.codecov.io/gh/apache/texera/pull/7729?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 90.95%. Comparing base ([`1011ff7`](https://app.codecov.io/gh/apache/texera/commit/1011ff7d501ad05a7e30605893eea8cc99e29bf5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`0ebfd5f`](https://app.codecov.io/gh/apache/texera/commit/0ebfd5fe0eb2a8ce780d8aff458a121cc105c639?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 4 commits behind head on main.
:white_check_mark: All tests successful. No failed tests found.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #7729 +/- ##
============================================
+ Coverage 90.93% 90.95% +0.01%
- Complexity 4452 4454 +2
============================================
Files 1175 1174 -1
Lines 47140 47139 -1
Branches 5284 5284
============================================
+ Hits 42869 42877 +8
+ Misses 2581 2572 -9
Partials 1690 1690
```
| [Flag](https://app.codecov.io/gh/apache/texera/pull/7729/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | *Carryforward flag |
|---|---|---|---|
| [access-control-service](https://app.codecov.io/gh/apache/texera/pull/7729/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `81.00% <ø> (ø)` | | Carriedforward from [1011ff7](https://app.codecov.io/gh/apache/texera/commit/1011ff7d501ad05a7e30605893eea8cc99e29bf5?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [agent-service](https://app.codecov.io/gh/apache/texera/pull/7729/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `98.62% <ø> (ø)` | | Carriedforward from [1011ff7](https://app.codecov.io/gh/apache/texera/commit/1011ff7d501ad05a7e30605893eea8cc99e29bf5?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [amber](https://app.codecov.io/gh/apache/texera/pull/7729/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `87.44% <ø> (+0.05%)` | :arrow_up: | |
| [computing-unit-managing-service](https://app.codecov.io/gh/apache/texera/pull/7729/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.67% <ø> (ø)` | | Carriedforward from [1011ff7](https://app.codecov.io/gh/apache/texera/commit/1011ff7d501ad05a7e30605893eea8cc99e29bf5?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [config-service](https://app.codecov.io/gh/apache/texera/pull/7729/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `86.73% <ø> (ø)` | | Carriedforward from [1011ff7](https://app.codecov.io/gh/apache/texera/commit/1011ff7d501ad05a7e30605893eea8cc99e29bf5?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [file-service](https://app.codecov.io/gh/apache/texera/pull/7729/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `68.90% <ø> (ø)` | | Carriedforward from [1011ff7](https://app.codecov.io/gh/apache/texera/commit/1011ff7d501ad05a7e30605893eea8cc99e29bf5?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [frontend](https://app.codecov.io/gh/apache/texera/pull/7729/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `92.44% <ø> (ø)` | | Carriedforward from [1011ff7](https://app.codecov.io/gh/apache/texera/commit/1011ff7d501ad05a7e30605893eea8cc99e29bf5?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [notebook-migration-service](https://app.codecov.io/gh/apache/texera/pull/7729/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.74% <ø> (ø)` | | Carriedforward from [1011ff7](https://app.codecov.io/gh/apache/texera/commit/1011ff7d501ad05a7e30605893eea8cc99e29bf5?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [pyamber](https://app.codecov.io/gh/apache/texera/pull/7729/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `97.57% <ø> (ø)` | | Carriedforward from [1011ff7](https://app.codecov.io/gh/apache/texera/commit/1011ff7d501ad05a7e30605893eea8cc99e29bf5?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [workflow-compiling-service](https://app.codecov.io/gh/apache/texera/pull/7729/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.19% <ø> (ø)` | | Carriedforward from [1011ff7](https://app.codecov.io/gh/apache/texera/commit/1011ff7d501ad05a7e30605893eea8cc99e29bf5?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
*This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/texera/pull/7729?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org