Skip to content

Commit

Permalink
test: fix context usage in long-running background tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
cbarbian-sap committed Aug 23, 2023
1 parent 83c1820 commit 6aab24f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ var _ = BeforeSuite(func() {
return
case <-time.After(100 * time.Millisecond):
namespaceList := &corev1.NamespaceList{}
err := cli.List(ctx, namespaceList)
err := cli.List(context.Background(), namespaceList)
Expect(err).NotTo(HaveOccurred())
for _, namespace := range namespaceList.Items {
if !namespace.DeletionTimestamp.IsZero() && slices.Contains(namespace.Spec.Finalizers, "kubernetes") {
namespace.Spec.Finalizers = slices.Remove(namespace.Spec.Finalizers, "kubernetes")
err := cli.SubResource("finalize").Update(ctx, &namespace)
err := cli.SubResource("finalize").Update(context.Background(), &namespace)
Expect(err).NotTo(HaveOccurred())
}
Expect(err).NotTo(HaveOccurred())
Expand Down

0 comments on commit 6aab24f

Please sign in to comment.