Merge pull request #27286 from Random-Liu/fix-node-problem-detector-test

Automatic merge from submit-queue

Make it blocks in NodeProblemDetector e2e test serial.

Fix #27276.

Move the 3 `It` blocks into 1 `It` block, so that the test itself is running serially. See https://github.com/kubernetes/kubernetes/issues/27276#issuecomment-225655308.

Mark P0 to match the priority of the issue. @dchen1107 

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
This commit is contained in:
k8s-merge-robot 2016-06-13 15:00:13 -07:00 committed by GitHub
commit 8bcecac12f

View File

@ -193,18 +193,16 @@ var _ = framework.KubeDescribe("NodeProblemDetector", func() {
Expect(f.WaitForPodRunning(name)).To(Succeed())
})
It("should generate default node condition after started", func() {
It("should generate node condition and events for corresponding errors", func() {
By("Make sure no events are generated")
Consistently(func() error {
return verifyNoEvents(c.Events(eventNamespace), eventListOptions)
}, pollConsistent, pollInterval).Should(Succeed())
By("Make sure the node condition is false")
By("Make sure the default node condition is false")
Consistently(func() error {
return verifyCondition(c.Nodes(), node.Name, condition, api.ConditionFalse, defaultReason, defaultMessage)
}, pollConsistent, pollInterval).Should(Succeed())
})
It("should generate event when temporary error happens", func() {
num := 3
By(fmt.Sprintf("Inject %d temporary errors", num))
Expect(framework.IssueSSHCommand(injectCommand(tempMessage, num), framework.TestContext.Provider, node)).To(Succeed())
@ -216,20 +214,18 @@ var _ = framework.KubeDescribe("NodeProblemDetector", func() {
Consistently(func() error {
return verifyEvents(c.Events(eventNamespace), eventListOptions, num, tempReason, tempMessage)
}, pollConsistent, pollInterval).Should(Succeed())
By("Make sure the node condition is false")
By("Make sure the node condition is still false")
Expect(verifyCondition(c.Nodes(), node.Name, condition, api.ConditionFalse, defaultReason, defaultMessage)).To(Succeed())
})
It("should generate node condition when permanent error happens", func() {
By("Inject 1 permanent error")
Expect(framework.IssueSSHCommand(injectCommand(permMessage, 1), framework.TestContext.Provider, node)).To(Succeed())
By("Make sure the corresponding node condition is generated")
Eventually(func() error {
return verifyCondition(c.Nodes(), node.Name, condition, api.ConditionTrue, permReason, permMessage)
}, pollTimeout, pollInterval).Should(Succeed())
By("Make sure no events are generated")
By("Make sure no new events are generated")
Consistently(func() error {
return verifyNoEvents(c.Events(eventNamespace), eventListOptions)
return verifyEvents(c.Events(eventNamespace), eventListOptions, num, tempReason, tempMessage)
}, pollConsistent, pollInterval).Should(Succeed())
})