Yicong-Huang opened a new pull request, #4819:
URL: https://github.com/apache/texera/pull/4819

   ### What changes were proposed in this PR?
   
   Adds scalatest coverage for two messaging-layer helpers under 
`amber/src/main/scala/org/apache/texera/amber/engine/architecture/messaginglayer/`:
   
   - `AmberFIFOChannel` — per-channel FIFO/exactly-once enforcer with stash, 
holdCredit, portId.
   - `CongestionControl` — TCP-style sliding-window send queue with slow start, 
ack-window adjustments, resend bookkeeping.
   
   `AmberFIFOChannel`'s spec covers initial state, 
in-order/duplicate/ahead/drain semantics on `acceptMessage`, FIFO `take` with 
credit decrement, `enable` toggle, queue/stash size accessors, and the 
`setPortId`/`getPortId` round-trip including the no-set NPE pin. 
`CongestionControl`'s spec covers `canSend`, 
`enqueueMessage`+`getBufferedMessagesToSend` window release, 
`markMessageInTransit`, the ack growth math (slow-start vs. linear past 
`ssThreshold`), unknown-id ack as no-op, `getTimedOutInTransitMessages`, 
`getAllMessages` union, and the `getStatusReport` format.
   
   Real-clock-dependent paths in `CongestionControl` (the resend timeout and 
the timed-out window-shrink branch) are noted in comments rather than driven 
through `Thread.sleep` so the suite stays fast — those belong in an integration 
test with a controlled clock.
   
   ### Any related issues, documentation, discussions?
   
   Closes #4817.
   
   Bug filed separately: `AmberFIFOChannel.getPortId` calls `.get` on an Option 
that defaults to None and throws `NoSuchElementException` with no context when 
invoked before `setPortId`. Pinned in the spec as the current behavior.
   
   ### How was this PR tested?
   
   ```
   sbt scalafmtCheckAll
   sbt "WorkflowExecutionService/testOnly 
org.apache.texera.amber.engine.architecture.messaginglayer.AmberFIFOChannelSpec 
org.apache.texera.amber.engine.architecture.messaginglayer.CongestionControlSpec"
   ```
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (claude-opus-4-7)


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to