mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Fix broken node test from 7a54f94
This commit is contained in:
parent
7a54f94cf4
commit
f258737e84
@ -120,7 +120,6 @@ var _ = Describe("Kubelet", func() {
|
|||||||
It("it should report resource usage through the stats api", func() {
|
It("it should report resource usage through the stats api", func() {
|
||||||
By("Returning stats summary")
|
By("Returning stats summary")
|
||||||
resp, err := http.Get(*kubeletAddress + "/stats/summary")
|
resp, err := http.Get(*kubeletAddress + "/stats/summary")
|
||||||
now := time.Now()
|
|
||||||
Expect(err).To(BeNil(), fmt.Sprintf("Failed to get /stats/summary"))
|
Expect(err).To(BeNil(), fmt.Sprintf("Failed to get /stats/summary"))
|
||||||
summary := stats.Summary{}
|
summary := stats.Summary{}
|
||||||
contentsBytes, err := ioutil.ReadAll(resp.Body)
|
contentsBytes, err := ioutil.ReadAll(resp.Body)
|
||||||
@ -130,9 +129,6 @@ var _ = Describe("Kubelet", func() {
|
|||||||
err = decoder.Decode(&summary)
|
err = decoder.Decode(&summary)
|
||||||
Expect(err).To(BeNil(), fmt.Sprintf("Failed to parse /stats/summary to go struct: %+v", resp))
|
Expect(err).To(BeNil(), fmt.Sprintf("Failed to parse /stats/summary to go struct: %+v", resp))
|
||||||
|
|
||||||
By("Having the correct time")
|
|
||||||
Expect(summary.Time.Time).To(BeTemporally("~", now, 20*time.Second))
|
|
||||||
|
|
||||||
By("Having resources for node")
|
By("Having resources for node")
|
||||||
Expect(summary.Node.NodeName).To(Equal(*nodeName))
|
Expect(summary.Node.NodeName).To(Equal(*nodeName))
|
||||||
Expect(summary.Node.CPU.UsageCoreNanoSeconds).NotTo(BeNil())
|
Expect(summary.Node.CPU.UsageCoreNanoSeconds).NotTo(BeNil())
|
||||||
|
Loading…
Reference in New Issue
Block a user