volcano-sh / volcano-sh/agentcube
test(workloadmanager): add unit tests for SandboxReconciler
@Maximus-08 is already working on this.
Since May 27, 2026.
- Dominant language
- Go
- Stars
- 167
- Forks
- 88
- Avg merge
- 44m
- Merged PRs (30d)
- 1
Description
What would you like to be added:
A new unit test suite under pkg/workloadmanager/sandbox_controller_test.go to cover SandboxReconciler (non-existent sandbox, pending sandbox, ready sandbox notification flow).
A fix in WatchSandboxOnce to close and clean up any pre-existing watcher channel for the same key to prevent goroutine leaks on duplicate registration.
Why is this needed:
SandboxReconciler currently has no unit test coverage, posing regression risks.
If WatchSandboxOnce is called twice for the same key, it silently overwrites the map entry, leaving the first channel permanently orphaned and block-waiting goroutines leaked.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.