Skip to content

Commit 5013b3f

Browse files
committed
Return delete polling timeout errors.
1 parent 4449348 commit 5013b3f

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

pkg/utils/dataset/volume/delete.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func deleteFusePersistentVolumeIfExists(ctx context.Context, client client.Clien
6767
}
6868
return !found, nil
6969
})
70-
if pollErr != nil && ctx.Err() != nil {
70+
if pollErr != nil {
7171
return pollErr
7272
}
7373

@@ -136,7 +136,7 @@ func DeleteFusePersistentVolumeClaim(ctx context.Context,
136136

137137
return false, nil
138138
})
139-
if pollErr != nil && ctx.Err() != nil {
139+
if pollErr != nil {
140140
return pollErr
141141
}
142142

pkg/utils/dataset/volume/delete_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ var _ = Describe("Delete Volume Tests", Label("pkg.utils.dataset.volume.delete_t
287287
err := DeleteFusePersistentVolumeClaim(context.Background(), clientObj, runtimeInfo, log)
288288
// Either succeeds or times out - both are valid for this test
289289
if err != nil {
290-
Expect(err.Error()).To(ContainSubstring("not cleaned up after 10-second retry"))
290+
Expect(err.Error()).To(SatisfyAny(
291+
ContainSubstring("not cleaned up after 10-second retry"),
292+
ContainSubstring("context deadline exceeded"),
293+
))
291294
}
292295
})
293296
})
@@ -433,7 +436,10 @@ var _ = Describe("Delete Volume Tests", Label("pkg.utils.dataset.volume.delete_t
433436
// The function should attempt to remove the finalizer
434437
// Depending on fake client behavior, this may succeed or timeout
435438
if err != nil {
436-
Expect(err.Error()).To(ContainSubstring("not cleaned up after 10-second retry"))
439+
Expect(err.Error()).To(SatisfyAny(
440+
ContainSubstring("not cleaned up after 10-second retry"),
441+
ContainSubstring("context deadline exceeded"),
442+
))
437443
}
438444
})
439445
})

0 commit comments

Comments
 (0)