Skip to content

Add unit tests for cluster adaptive flow throttling feature - #400

Merged
huanglongchao merged 1 commit into
sofastack:masterfrom
hui-cha:huicha/feature/ut-cover
Apr 9, 2026
Merged

huanglongchao merged 1 commit into
sofastack:masterfrom
hui-cha:huicha/feature/ut-cover

Conversation

@hui-cha

@hui-cha hui-cha commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add comprehensive unit tests to improve incremental code coverage for the adaptive flow throttling feature introduced in PR Add cluster adaptive flow throttling and admin APIs #382
  • Cover new classes: FlowOperationThrottlingStatus, SystemLoad, AdaptiveFlowOperationConfig, SessionMetricsCollector
  • Extend existing tests: NodeTest, HeartbeatRequestHandlerTest, DefaultSessionServerManagerTest, AdaptiveFlowOperationLimiterTest
  • Add new test for BaseHeartBeatResponse with FlowOperationThrottlingStatus parameter

Test Coverage

Class Coverage
FlowOperationThrottlingStatus 100%
SystemLoad 100%
AdaptiveFlowOperationConfig 100%
AdaptiveFlowOperationLimiter 97.4%
SessionMetricsCollector 81.8% (JDK compatibility branches)

Test plan

  • All new tests pass locally
  • Existing tests still pass
  • Incremental code coverage >= 90% for most classes

🤖 Generated with Claude Code

…k#382)

Add comprehensive unit tests to improve incremental code coverage for the
adaptive flow throttling feature introduced in PR sofastack#382. This includes tests for:
- FlowOperationThrottlingStatus: factory methods, getters/setters, copy
- SystemLoad: static equals, instance methods, hashCode
- SessionNode: new constructor with SystemLoad parameter
- BaseHeartBeatResponse: new constructor with FlowOperationThrottlingStatus
- AdaptiveFlowOperationConfig: default values and all setters
- AdaptiveFlowOperationLimiter: edge cases and config validation
- HeartbeatRequestHandler: SESSION heartbeat with throttling status
- DefaultSessionServerManager: SystemLoad change detection
- SessionMetricsCollector: singleton and system load metrics

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@huanglongchao
huanglongchao merged commit ad06cdc into sofastack:master Apr 9, 2026
3 of 5 checks passed
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.

2 participants