-
Notifications
You must be signed in to change notification settings - Fork 880
tests: tentative fixes for sporadic host and kvm failures #3434
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just two nits.
func waitOrFail(t *testing.T, child *gexpect.ExpectSubprocess, expectedStatus int) { | ||
bufOut := []string{} | ||
ttyIn, ttyOut := child.AsyncInteractChannels() | ||
close(ttyIn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Can we leave a TODO to change gexpect.AsyncInteractChannels
to accept channels rather than returning them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean opening a ticket to gexpect or a just a reminder for us here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest just a TODO here, I'll set up a PR in gexpect and some documentation around the usage patterns for these channels.
bufOut := []string{} | ||
ttyIn, ttyOut := child.AsyncInteractChannels() | ||
close(ttyIn) | ||
for line := range ttyOut { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I guess) this relies on the fact that the ttyOut
chan will be closed when a real err happens or io.EOF
in https://github.com/ThomasRooney/gexpect/blob/8e96656e8fb794d716ee75b5a8cecbc15cde4393/gexpect.go#L167. I think we should document this here and in gexpect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does, I'll note this down.
This commit fixes waitOrFail to drain output from the child, in order to avoid a deadlock situation where the children is blocked on a write toward the parent, while the parent is blocked waiting for the children.
This raises the pod-stop timeout from 5 to 15 seconds. Sporadic test failures on KVM flavor may be due to a too strict limit, so we just 3x here to make sure failures are not due to bad timing.
fd8ee7a
to
46e9c15
Compare
Rebased, PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR tentatively fixes the following flakes: