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

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

@manduinca
manduinca requested review from a team as code owners August 5, 2026 01:42
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 force-pushed the test/actor-runtime-coverage branch from bc246cf to 24752ef Compare September 20, 2026 08:51
@codecov

codecov Bot commented Sep 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.61%. Comparing base (ca8df1f) to head (24752ef).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1796      +/-   ##
============================================
+ Coverage     78.41%   78.61%   +0.19%     
- Complexity     2492     2503      +11     
============================================
  Files           253      253              
  Lines          7561     7561              
  Branches        785      785              
============================================
+ Hits           5929     5944      +15     
+ Misses         1269     1254      -15     
  Partials        363      363              

☔ 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