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/06/13 00:30:11 UTC

[I] add unit test coverage for DeadLetterMonitorActor [texera]

aglinxinyuan opened a new issue, #5663:
URL: https://github.com/apache/texera/issues/5663

   ## Background
   
   `DeadLetterMonitorActor` in `amber/src/main/scala/org/apache/texera/amber/engine/architecture/messaginglayer/DeadLetterMonitorActor.scala` currently lacks a dedicated unit-spec. It is a tiny Pekko actor subscribed to `DeadLetter` events; when a `DeadLetter` carries a `WorkflowActor.NetworkMessage`, the actor sends `MessageBecomesDeadLetter(msg)` back to the original `NetworkSenderActor` (which then retries / surfaces the failure).
   
   ```scala
   class DeadLetterMonitorActor extends Actor {
     override def receive: Receive = {
       case d: DeadLetter =>
         d.message match {
           case msg: NetworkMessage =>
             d.sender ! MessageBecomesDeadLetter(msg)
           case other =>
           // skip for now
         }
       case _ =>
     }
   }
   ```
   
   ## Behavior to pin
   
   | Surface | Contract |
   | --- | --- |
   | `DeadLetter` carrying a `NetworkMessage` | the original sender (`d.sender`) receives a `MessageBecomesDeadLetter(msg)` |
   | The forwarded payload equals `d.message` | the `NetworkMessage` is reflected back unchanged (no copy / no field drop) |
   | `DeadLetter` carrying a non-`NetworkMessage` payload (e.g. `"hello"`, `Int`, a different case class) | no reply is sent to `d.sender` |
   | Non-`DeadLetter` messages | are silently ignored (the catch-all `case _` branch) |
   | Multiple `DeadLetter` events | each is handled independently — no cross-talk |
   
   ## Scope
   
   - New spec file: `DeadLetterMonitorActorSpec.scala` (matches the `<srcClassName>Spec.scala` convention).
   - Use `org.apache.pekko.testkit.{TestKit, TestProbe, TestActorRef}` — the existing actor specs in this codebase (`NetworkInputGatewaySpec`, `OutputManagerSpec`) demonstrate the pattern.
   - `TestProbe` as the original sender; assert `expectMsg`/`expectNoMessage` after sending `DeadLetter(...)` to a `TestActorRef[DeadLetterMonitorActor]`.
   - No production-code changes.
   
   ## Hint
   
   Construct a `DeadLetter` directly:
   
   ```scala
   val probe = TestProbe()
   val ref = TestActorRef(new DeadLetterMonitorActor)
   val deadLetter = DeadLetter(message, probe.ref, ref)
   ref.tell(deadLetter, probe.ref)
   probe.expectMsg(MessageBecomesDeadLetter(...))  // or expectNoMessage()
   ```
   
   You'll need to construct a real `NetworkMessage` (see `WorkflowActor` companion) — pick any valid `WorkflowFIFOMessage` payload (`DataFrame(Array.empty)` is the cheapest).


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] add unit test coverage for DeadLetterMonitorActor [texera]

Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan closed issue #5663: add unit test coverage for DeadLetterMonitorActor
URL: https://github.com/apache/texera/issues/5663


-- 
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: [I] add unit test coverage for DeadLetterMonitorActor [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #5663:
URL: https://github.com/apache/texera/issues/5663#issuecomment-4696749752

   <!-- texera:template-compliance -->
   👋 Thanks for opening this issue, @aglinxinyuan!
   
   It looks like the issue description doesn't quite follow our template yet:
   
   - This issue doesn't appear to use one of our templates (Bug, Feature, or Task). Please open it using a template so the required details are captured.
   
   Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.
   
   You can find the template prompts by editing the description, or see [CONTRIBUTING.md](https://github.com/apache/texera/blob/main/CONTRIBUTING.md) for the full contribution flow.
   


-- 
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: [I] add unit test coverage for DeadLetterMonitorActor [texera]

Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on issue #5663:
URL: https://github.com/apache/texera/issues/5663#issuecomment-4700345870

   /take


-- 
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