Skip to content

Commit 393ecd6

Browse files
committed
simplified code, so that AI understands it.
1 parent fc375ce commit 393ecd6

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

controllers/hetznerbaremetalmachine_controller_test.go

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package controllers
1818

1919
import (
2020
"context"
21+
"fmt"
2122
"testing"
2223
"time"
2324

@@ -404,12 +405,13 @@ var _ = Describe("HetznerBareMetalMachineReconciler", func() {
404405
By("deleting hbmm")
405406
Expect(testEnv.Delete(ctx, bmMachine)).To(Succeed())
406407

407-
Eventually(func() bool {
408-
if err := testEnv.Get(ctx, key, bmMachine); apierrors.IsNotFound(err) {
409-
return true
408+
Eventually(func() error {
409+
err := testEnv.Get(ctx, key, bmMachine)
410+
if apierrors.IsNotFound(err) {
411+
return nil
410412
}
411-
return false
412-
}, timeout, time.Second).Should(BeTrue())
413+
return err
414+
}, timeout, time.Second).Should(Succeed())
413415

414416
By("making sure the host has been deprovisioned")
415417

@@ -457,12 +459,13 @@ var _ = Describe("HetznerBareMetalMachineReconciler", func() {
457459
By("deleting bm machine")
458460
Expect(testEnv.Delete(ctx, bmMachine)).To(Succeed())
459461

460-
Eventually(func() bool {
461-
if err := testEnv.Get(ctx, key, bmMachine); apierrors.IsNotFound(err) {
462-
return true
462+
Eventually(func() error {
463+
err := testEnv.Get(ctx, key, bmMachine)
464+
if apierrors.IsNotFound(err) {
465+
return nil
463466
}
464-
return false
465-
}, timeout, time.Second).Should(BeTrue())
467+
return err
468+
}, timeout, time.Second).Should(Succeed())
466469

467470
By("making sure the host has been deprovisioned")
468471

0 commit comments

Comments
 (0)