kill client after timeout in integration tests

this should fix the hang-issue of #163
This commit is contained in:
Lucas Clemente
2016-06-03 15:12:53 +02:00
parent c7324bbfe9
commit f6be8716b5

View File

@@ -96,6 +96,7 @@ var _ = Describe("Integration tests", func() {
)
session, err := Start(command, GinkgoWriter, GinkgoWriter)
Expect(err).NotTo(HaveOccurred())
defer session.Kill()
Eventually(session).Should(Exit(0))
Expect(session.Out).To(Say("Response:\nheaders: HTTP/1.1 200\nstatus: 200\n\nbody: Hello, World!\n"))
})
@@ -111,6 +112,7 @@ var _ = Describe("Integration tests", func() {
)
session, err := Start(command, GinkgoWriter, GinkgoWriter)
Expect(err).NotTo(HaveOccurred())
defer session.Kill()
Eventually(session).Should(Exit(0))
Expect(session.Out).To(Say("Response:\nheaders: HTTP/1.1 200\nstatus: 200\n\nbody: foo\n"))
})
@@ -125,6 +127,7 @@ var _ = Describe("Integration tests", func() {
)
session, err := Start(command, nil, GinkgoWriter)
Expect(err).NotTo(HaveOccurred())
defer session.Kill()
Eventually(session, 2).Should(Exit(0))
Expect(bytes.Contains(session.Out.Contents(), data)).To(BeTrue())
})
@@ -145,6 +148,7 @@ var _ = Describe("Integration tests", func() {
)
session, err := Start(command, nil, GinkgoWriter)
Expect(err).NotTo(HaveOccurred())
defer session.Kill()
Eventually(session, 3).Should(Exit(0))
Expect(bytes.Contains(session.Out.Contents(), data)).To(BeTrue())
}()