Skip to content

Commit

Permalink
reverting DeferCleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
so-sahu committed Aug 20, 2024
1 parent f0b9280 commit ea32ead
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion internal/server/event_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,17 @@ var _ = Describe("ListEvents", func() {
Expect(err).NotTo(HaveOccurred())
Expect(createResp).NotTo(BeNil())

DeferCleanup(machineClient.DeleteMachine, ctx, &iri.DeleteMachineRequest{MachineId: createResp.Machine.Metadata.Id})
DeferCleanup(func(ctx SpecContext) {
Eventually(func(g Gomega) bool {
_, err := machineClient.DeleteMachine(ctx, &iri.DeleteMachineRequest{MachineId: createResp.Machine.Metadata.Id})
g.Expect(err).To(SatisfyAny(
BeNil(),
MatchError(ContainSubstring("NotFound")),
))
_, err = libvirtConn.DomainLookupByUUID(libvirtutils.UUIDStringToBytes(createResp.Machine.Metadata.Id))
return libvirt.IsNotFound(err)
}).Should(BeTrue())
})

By("ensuring domain and domain XML is created for machine")
var domain libvirt.Domain
Expand Down

0 comments on commit ea32ead

Please sign in to comment.