Skip to content

Commit 5c819b8

Browse files
crhinoCaroline Taymor
authored andcommitted
fix flakey tests
Ignore io.EOF error. There is a race between the local and remote side of the SSH connection closing that pipe. Signed-off-by: Caroline Taymor <[email protected]>
1 parent d0a23d3 commit 5c819b8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

handlers/session_channel_handler_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,9 @@ var _ = Describe("SessionChannelHandler", func() {
348348
Eventually(runner.SignalCallCount).Should(Equal(1))
349349

350350
err = stdin.Close()
351-
Expect(err).NotTo(HaveOccurred())
351+
if err != nil {
352+
Expect(err).To(Equal(io.EOF), "expected no error or ignorable EOF error")
353+
}
352354

353355
err = session.Wait()
354356
Expect(err).To(HaveOccurred())
@@ -779,7 +781,9 @@ var _ = Describe("SessionChannelHandler", func() {
779781
Expect(err).NotTo(HaveOccurred())
780782

781783
err = stdin.Close()
782-
Expect(err).NotTo(HaveOccurred())
784+
if err != nil {
785+
Expect(err).To(Equal(io.EOF), "expected no error or ignorable EOF error")
786+
}
783787

784788
err = session.Wait()
785789
Expect(err).NotTo(HaveOccurred())

0 commit comments

Comments
 (0)