Skip to content

Feat unit tests#599

Open
KamToHung wants to merge 4 commits into
dromara:masterfrom
KamToHung:feat_unit_tests
Open

Feat unit tests#599
KamToHung wants to merge 4 commits into
dromara:masterfrom
KamToHung:feat_unit_tests

Conversation

@KamToHung

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings July 6, 2026 12:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds unit tests in test-core to validate timeout alarm behavior, CPU metrics collection behavior, and notice dispatch behavior in the DynamicTp core components.

Changes:

  • Added tests for RunTimeoutTimerTask to verify timeout counting, alarm triggering, and optional thread interruption.
  • Extended SystemMetricsCaptorTest with cases verifying CpuMetricsCaptor CPU usage updates and exception handling.
  • Added NoticeManagerTest to verify CHANGE notice dispatch behavior through the notify invoker chain.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
test/test-core/src/test/java/org/dromara/dynamictp/test/core/timer/RunTimeoutTimerTaskTest.java New unit tests for run-timeout timer task counting, alarm call, and interrupt behavior.
test/test-core/src/test/java/org/dromara/dynamictp/test/core/system/SystemMetricsCaptorTest.java Additional CPU metrics tests using controlled CPU time via static mocking and reflection.
test/test-core/src/test/java/org/dromara/dynamictp/test/core/notify/manager/NoticeManagerTest.java New unit test verifying CHANGE notice dispatch by temporarily overriding the notify invoker chain head.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +60 to +63
@ExtendWith(SpringExtension.class)
@ContextConfiguration(classes = NoticeManagerTest.ContextConfig.class)
@Execution(ExecutionMode.SAME_THREAD)
class NoticeManagerTest {
@yanhom1314

Copy link
Copy Markdown
Collaborator

把ci的 error修下吧

@KamToHung

Copy link
Copy Markdown
Collaborator Author

把ci的 error修下吧

ok

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.

3 participants