The GitHub Actions job "Benchmarks PR Comment" on texera.git/main has succeeded.
Run started by GitHub user PG1204 (triggered by PG1204).

Head commit for run:
7e9cabf2bf4edc0540ab7397dd644bd96cc2a042 / Xinyuan Lin <[email protected]>
test(amber): add unit test coverage for WorkerBatchInternalQueue (#5553)

### What changes were proposed in this PR?

Pin behavior of `WorkerBatchInternalQueue` — the per-DP-thread mailbox
trait used by the Python worker. Previously uncovered; the only
uncovered module in the `pythonworker` package whose contract is
unit-testable without standing up a real Python subprocess. No
production-code changes.

| Spec | Source class | Tests |
| --- | --- | --- |
| `WorkerBatchInternalQueueSpec` | `WorkerBatchInternalQueue` (trait +
companion) | 17 |

Spec file name follows the `<srcClassName>Spec.scala` one-to-one
convention.

**Behavior pinned**

| Surface | Contract |
| --- | --- |
| `enqueueData` + `getElement` | round-trip a `DataElement` (with both
`DataFrame` and `StateFrame` payloads) |
| `enqueueCommand` + `getElement` | round-trip a `ControlElement` |
| `enqueueActorCommand` + `getElement` | round-trip an
`ActorCommandElement` |
| Multi-priority dispatch | control elements are returned **before**
data elements when both are queued (sub-queue 0 < 1) |
| FIFO within the control queue | `ControlElement` enqueued first comes
out before `ActorCommandElement` enqueued second |
| `getDataQueueLength` | reports only data-queue items (control is
excluded) |
| `getControlQueueLength` / `isControlQueueEmpty` | report all
control-queue items (`ControlElement` + `ActorCommandElement`) |
| `disableDataQueue` | hides queued data from `getElement` until
`enableDataQueue` is called; control flow still moves |
| `getQueuedCredit(sender)` | `0` initially; tracks bytes-in minus
bytes-out for `DataFrame` payloads per sender; stays `0` for control /
`StateFrame` payloads; per-sender accounting is independent; accumulates
across multiple enqueues for the same sender |
| Companion constants | `CONTROL_QUEUE == 0`, `DATA_QUEUE == 1`, and
`CONTROL_QUEUE < DATA_QUEUE` (relied on by the multi-priority semantics)
|

The trait is exercised through a small test-only subclass (`class
TestQueue extends WorkerBatchInternalQueue`), with
`DirectControlMessagePayload` represented by a local marker case object
since the production trait carries no behavior.

### Any related issues, documentation, discussions?

Closes #5552.

### How was this PR tested?

Pure unit-test addition; verified locally with:

- `sbt "WorkflowExecutionService/testOnly
org.apache.texera.amber.engine.architecture.pythonworker.WorkerBatchInternalQueueSpec"`
— 17 tests, all green
- `sbt scalafmtCheckAll` — clean
- CI to confirm

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Sonnet 4.5)

---------

Signed-off-by: Yicong Huang <[email protected]>
Co-authored-by: Yicong Huang <[email protected]>
Co-authored-by: Copilot Autofix powered by AI 
<[email protected]>

Report URL: https://github.com/apache/texera/actions/runs/27434915742

With regards,
GitHub Actions via GitBox

Reply via email to