Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
pbacsko committed Oct 24, 2024
1 parent 886e19d commit f196feb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/e2e/foreign_pod/foreign_pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ var _ = Describe("", func() {
sleepObj1.Spec.SchedulerName = ""
Ω(err).NotTo(gomega.HaveOccurred())
By("Creating foreign sleep pod #1")
_, err = kClient.CreatePod(sleepObj1, ns)
pod1, err := kClient.CreatePod(sleepObj1, ns)
Ω(err).NotTo(gomega.HaveOccurred())

// create sleep pod2, scheduled by the default scheduler
sleepObj2, err := k8s.InitSleepPod(sleepPod2Config)
sleepObj2.Spec.SchedulerName = ""
Ω(err).NotTo(gomega.HaveOccurred())
By("Creating foreign sleep pod #2")
_, err = kClient.CreatePod(sleepObj2, ns)
pod2, err := kClient.CreatePod(sleepObj2, ns)
Ω(err).NotTo(gomega.HaveOccurred())

// wait until pod1 & pod2 are in Running state
Expand All @@ -78,16 +78,19 @@ var _ = Describe("", func() {
err = kClient.WaitForPodRunning(ns, sleepPod2Config.Name, 30*time.Second)
Ω(err).NotTo(gomega.HaveOccurred())

fmt.Fprintf(ginkgo.GinkgoWriter, "pod1 %s\n", pod1.UID)
fmt.Fprintf(ginkgo.GinkgoWriter, "pod2 %s\n", pod2.UID)

// retrieve foreign pod info
By("Retrieving foreign allocations")
nodes, err := restClient.GetNodes("default")
Ω(err).NotTo(gomega.HaveOccurred())
foreignAllocs := make([]*dao.ForeignAllocationDAOInfo, 0, 2)
for _, n := range *nodes {
fmt.Fprintf(ginkgo.GinkgoWriter, "Checking node %s", n.NodeID)
fmt.Fprintf(ginkgo.GinkgoWriter, "Checking node %s\n", n.NodeID)
if len(n.ForeignAllocations) > 0 {
for _, falloc := range n.ForeignAllocations {
fmt.Fprintf(ginkgo.GinkgoWriter, "Found allocation %s", falloc.AllocationKey)
fmt.Fprintf(ginkgo.GinkgoWriter, "Found allocation %s\n", falloc.AllocationKey)
foreignAllocs = append(foreignAllocs, falloc)
}
}
Expand Down

0 comments on commit f196feb

Please sign in to comment.