Skip to content

Commit a608fdc

Browse files
authored
Add comments/notation to TestSyncMetadata in pkg/ddc/alluxio/metadata_test.go (#5048)
Signed-off-by: Bright0313 <2357784349@qq.com>
1 parent 68320df commit a608fdc

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

pkg/ddc/alluxio/metadata_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ import (
3636
"k8s.io/utils/ptr"
3737
)
3838

39+
// TestSyncMetadata verifies metadata synchronization logic in AlluxioEngine.
40+
//
41+
// The test covers three core scenarios:
42+
// 1. Normal metadata sync with pre-populated UfsTotal field (hbase dataset)
43+
// 2. Error handling when UfsTotal is empty but no restore path exists (spark dataset)
44+
// 3. Metadata restoration workflow when DataRestoreLocation is specified (hadoop dataset)
45+
//
46+
// Test implementation details:
47+
// - Uses fake Kubernetes client for API interactions
48+
// - Initializes test datasets with different status conditions
49+
// - Hooks AlluxioFileUtils.QueryMetaDataInfoIntoFile to simulate metadata queries
50+
// - Validates error handling in SyncMetadata execution
51+
// - Verifies unhook operation cleanup via wrappedUnhookQueryMetaDataInfoIntoFile
3952
func TestSyncMetadata(t *testing.T) {
4053
QueryMetaDataInfoIntoFileCommon := func(a operations.AlluxioFileUtils, key operations.KeyOfMetaDataFile, filename string) (value string, err error) {
4154
return "1024", nil

0 commit comments

Comments
 (0)