Skip to content

Commit f1d0e93

Browse files
Jade FishJade Fish
authored andcommitted
Add comments to TestAlluxioEngine_getGracefulShutdownLimits in pkg\ddc\alluxio\cache_test.go.
Signed-off-by: Jade Fish <221220013@smail.nju.edu.cn>
1 parent 1178175 commit f1d0e93

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

pkg/ddc/alluxio/cache_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,16 @@ func mockAlluxioReportMetrics() string {
429429
return r
430430
}
431431

432+
// TestAlluxioEngine_getGracefulShutdownLimits tests the getGracefulShutdownLimits method of the AlluxioEngine.
433+
// This test verifies the correct retrieval of graceful shutdown retry limits under different runtime configurations.
434+
// It covers three scenarios:
435+
// 1. When no CleanCachePolicy is specified, ensuring the default value (3) is returned.
436+
// 2. When CleanCachePolicy with MaxRetryAttempts is set, ensuring the configured value is returned.
437+
// 3. An error scenario where the runtime object might not be properly retrieved, testing error handling.
438+
// The test uses a fake Kubernetes client to simulate runtime object states and validate the method's behavior.
439+
//
440+
// Parameters:
441+
// - t: Testing handler for test reporting and control.
432442
func TestAlluxioEngine_getGracefulShutdownLimits(t *testing.T) {
433443
type fields struct {
434444
runtime *datav1alpha1.AlluxioRuntime

0 commit comments

Comments
 (0)