Background
In #5969, cheyang noted that both CronStatusHandler and OnEventStatusHandler in pkg/controllers/v1alpha1/dataprocess/status_handler.go have a code path where the related CronJob/Job is not found — which triggers helm release deletion and a retry. Neither path is covered by the existing tests.
The coverage was deferred as a follow-up to keep the PR focused. This issue tracks it.
What to do
Add unit tests in pkg/controllers/v1alpha1/dataprocess/status_handler_test.go covering:
CronStatusHandler: CronJob not found → helm release deleted and early return (no error, unchanged status)
OnEventStatusHandler: Job not found → helm release deleted and early return (no error, unchanged status)
Note: helm.DeleteReleaseIfExists shells out to the ddc-helm binary which is not available in the unit test environment — the same gap exists in DataLoad and DataMigrate OnceStatusHandler tests (tracked in #6065). The test strategy should mock or stub the helm call, or verify the early-return behavior without invoking the binary.
References
Background
In #5969, cheyang noted that both
CronStatusHandlerandOnEventStatusHandlerinpkg/controllers/v1alpha1/dataprocess/status_handler.gohave a code path where the related CronJob/Job is not found — which triggers helm release deletion and a retry. Neither path is covered by the existing tests.The coverage was deferred as a follow-up to keep the PR focused. This issue tracks it.
What to do
Add unit tests in
pkg/controllers/v1alpha1/dataprocess/status_handler_test.gocovering:CronStatusHandler: CronJob not found → helm release deleted and early return (no error, unchanged status)OnEventStatusHandler: Job not found → helm release deleted and early return (no error, unchanged status)Note:
helm.DeleteReleaseIfExistsshells out to theddc-helmbinary which is not available in the unit test environment — the same gap exists inDataLoadandDataMigrateOnceStatusHandler tests (tracked in #6065). The test strategy should mock or stub the helm call, or verify the early-return behavior without invoking the binary.References