Skip to content

Add unit tests for ActorRuntime reminder/timer invocation and close() - #1796

Open
manduinca wants to merge 1 commit into
dapr:masterfrom
manduinca:test/actor-runtime-coverage
Open

Add unit tests for ActorRuntime reminder/timer invocation and close()#1796
manduinca wants to merge 1 commit into
dapr:masterfrom
manduinca:test/actor-runtime-coverage

Conversation

@manduinca

Copy link
Copy Markdown
Contributor

Description

Follow-up to #1790, part of #369. Adds the remaining coverage for sdk-actors:

ActorRuntimeTest (9 new tests):

  • invokeReminder and invokeTimer: happy path (verifying the actor callback actually receives the deserialized payload) and unregistered actor type.
  • close(): shuts down the managed channel, and skips shutdown when the channel is already shut down.
  • Single-instance constructor guard (IllegalStateException).
  • Registering the same actor type twice keeps a single entity in the serialized config.
  • deactivate with an unregistered actor type.

ActorProxyImplTest (3 new tests):

  • @ActorMethod(name = ...) renaming reaches the client with the renamed method.
  • Serialization and deserialization failures surface as DaprException.

Issue reference

Part of #369

Checklist

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation / not needed

Covers ActorRuntime.invokeReminder and invokeTimer (happy path and
unregistered actor type), close() with and without an already-shutdown
channel, the single-instance constructor guard, duplicate actor
registration, and deactivate for an unregistered type. Also adds
ActorProxyImpl tests for @ACTORmethod(name) renaming and for
serialization/deserialization failures wrapped as DaprException.

Part of dapr#369

Signed-off-by: Jean Pierre Mandujano G. <jeanpierre.mandujano@gmail.com>
@manduinca
manduinca requested review from a team as code owners August 5, 2026 01:42
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.27%. Comparing base (2edf16c) to head (bc246cf).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1796      +/-   ##
============================================
+ Coverage     77.10%   77.27%   +0.16%     
- Complexity     2317     2328      +11     
============================================
  Files           245      245              
  Lines          7186     7186              
  Branches        750      750              
============================================
+ Hits           5541     5553      +12     
+ Misses         1284     1272      -12     
  Partials        361      361              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant