Skip to content

Commit

Permalink
Set stdin to nil for HyperV execs
Browse files Browse the repository at this point in the history
We're seeing a bug where failed Podman commands can hang in the
test suite, but somehow un-hang on STDIN activity (e.g. pressing
enter). On Brent's vague suspicion that it was related to STDIN,
I disabled STDIN on all execs from HyperV, and the hangs
disappear. I don't know why this is, or why the hangs happen in
the first place, but since this seems to work and should not have
any negative consequences that I can think of, here we go.

[NO NEW TESTS NEEDED] I have no idea how to test this one.

Signed-off-by: Matt Heon <mheon@redhat.com>
  • Loading branch information
mheon committed Dec 14, 2023
1 parent fb9e9de commit 5b717c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/machine/e2e/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func runWrapper(podmanBinary string, cmdArgs []string, timeout time.Duration, wa
}
GinkgoWriter.Println(podmanBinary + " " + strings.Join(cmdArgs, " "))
c := exec.Command(podmanBinary, cmdArgs...)
c.Stdin = nil
session, err := Start(c, GinkgoWriter, GinkgoWriter)
if err != nil {
Fail(fmt.Sprintf("Unable to start session: %q", err))
Expand Down
4 changes: 4 additions & 0 deletions pkg/machine/hyperv/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,8 @@ func (m *HyperVMachine) startHostNetworking() (string, machine.APIForwardingStat

logrus.Debugf("Starting gvproxy with command: %s %v", gvproxyBinary, c.Args)

c.Stdin = nil

if err := c.Start(); err != nil {
return "", 0, fmt.Errorf("unable to execute: %s: %w", cmd.ToCmdline(), err)
}
Expand Down Expand Up @@ -811,6 +813,8 @@ func (m *HyperVMachine) startHostNetworking() (string, machine.APIForwardingStat
}
}

fsCmd.Stdin = nil

if err := fsCmd.Start(); err != nil {
return "", 0, fmt.Errorf("unable to execute: %s %v: %w", executable, args, err)
}
Expand Down

0 comments on commit 5b717c0

Please sign in to comment.