Skip to content

Commit 80194af

Browse files
authored
Add comments to TestAlluxioEngine_getCleanCacheGracePeriodSeconds in pkg\ddc\alluxio\cache_test.go. (#5147)
Signed-off-by: haze <haze112358@163.com>
1 parent c5679c2 commit 80194af

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

pkg/ddc/alluxio/cache_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,13 @@ func TestAlluxioEngine_getGracefulShutdownLimits(t *testing.T) {
572572
}
573573
}
574574

575+
// TestAlluxioEngine_getCleanCacheGracePeriodSeconds verifies the behavior of
576+
// the AlluxioEngine.getCleanCacheGracePeriodSeconds() method.
577+
// It covers the following scenarios:
578+
// 1. When no CleanCachePolicy is defined in the runtime spec, the method should return the default value (60 seconds).
579+
// 2. When GracePeriodSeconds is explicitly set in CleanCachePolicy, the method should return the configured value.
580+
// 3. When the runtime object is not found or the GracePeriodSeconds is not defined properly, it should return an error.
581+
// The test uses a fake Kubernetes client initialized with deep-copied runtime objects to simulate the environment.
575582
func TestAlluxioEngine_getCleanCacheGracePeriodSeconds(t *testing.T) {
576583
type fields struct {
577584
runtime *datav1alpha1.AlluxioRuntime

0 commit comments

Comments
 (0)