Skip to content

Commit ad6edab

Browse files
committed
[DEBUG] Add extra log statements to understand why tests fail
1 parent 7aff421 commit ad6edab

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

mock/cache/SnapshotCache.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cache
22

33
import (
4+
"fmt"
45
"strings"
56
"sync"
67

@@ -95,10 +96,15 @@ func (snap *snapshotCache) FindSnapshot(k SnapshotCacheKey, v string) (int, Snap
9596

9697
func (snap *snapshotCache) FindSnapshotsBySourceVolumeID(sourceVolID string) []Snapshot {
9798
var snapshots []Snapshot
99+
fmt.Printf("[DEBUG] Checking %d snapshots for source volume ID %s\n", len(snap.snapshots), sourceVolID)
98100
for _, s := range snap.snapshots {
99101
if strings.EqualFold(sourceVolID, s.SnapshotCSI.SourceVolumeId) {
102+
fmt.Printf("[DEBUG] Found match on snapshot %v\n", s)
100103
snapshots = append(snapshots, s)
104+
} else {
105+
fmt.Printf("[DEBUG] Found NO MATCH on snapshot %v\n", s)
101106
}
102107
}
108+
fmt.Printf("[DEBUG] Returning %d snapshots for source volume ID %s\n", len(snapshots), sourceVolID)
103109
return snapshots
104110
}

pkg/sanity/controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,6 +1463,7 @@ var _ = DescribeSanity("ListSnapshots [Controller Server]", func(sc *TestContext
14631463
Expect(err).NotTo(HaveOccurred())
14641464

14651465
By("listing snapshots")
1466+
fmt.Println("[DEBUG] Listing Snapshots")
14661467
snapshots, err := c.ListSnapshots(
14671468
context.Background(),
14681469
&csi.ListSnapshotsRequest{SourceVolumeId: snapshotTarget1SrcVolID})

0 commit comments

Comments
 (0)