volcano-sh / volcano-sh/agentcube

test(workloadmanager): add unit tests for SandboxReconciler

Open
#362 1 comment 0 reactions 1 assignee View on GitHub

@Maximus-08 is already working on this.

Since May 27, 2026.

kind/enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.