Skip to content

Improve unit test coverage for adaptive flow throttling (#382)#403

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

Improve unit test coverage for adaptive flow throttling (#382)#403
huanglongchao merged 1 commit into
sofastack:masterfrom
hui-cha:huicha/feature/ut-cover

Conversation

@hui-cha
Copy link
Copy Markdown
Collaborator

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

Summary

  • Add comprehensive unit tests to achieve 99.3% line coverage of code changes from PR Add cluster adaptive flow throttling and admin APIs #382 (cluster adaptive flow throttling feature)
  • Cover throttling status propagation in heartbeat, local/cluster throttling state management, zone-level client off/on throttling, queryBlackList API, SessionMetricsCollector defensive branches, and AdaptiveFlowOperationLimiter exception handling

Test plan

  • All new tests pass (mvn test for session and meta modules)
  • JaCoCo coverage verified: 295/297 changed executable lines covered
  • Remaining 2 uncovered lines are JDK environment limitation (non-OpenJDK constructor branch) and JaCoCo bytecode limitation (implicit finally exception path)

🤖 Generated with Claude Code

…re (sofastack#382)

Add comprehensive tests to achieve 99.3% line coverage of changed code:
- MetaServerServiceImplTest: verify throttling status update and SystemLoad in heartbeat
- PushEfficiencyConfigUpdaterTest: cover throttling state management, isRunning, and stop cleanup
- ClientManagerResourceThrottlingTest: cover zone clientOff/clientOn throttling
- DataInfoIDBlacklistResourceTest: cover queryBlackList success/nodata/exception paths
- AutoPushEfficiencyRegulatorTest: cover SessionMetricsCollector initialization and usage
- SessionMetricsCollectorTest: cover defensive branches for unsupported JDK environments
- AdaptiveFlowOperationLimiterTest: cover safeProcess exception handling and null config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@huanglongchao huanglongchao merged commit d29e49a into sofastack:master Apr 14, 2026
3 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