Commit 867c9e4
Stop Windows hangs when last output is on stderr (#72)
* Stop Windows hangs when last output is on stderr
Terraform CLI runs sometimes only produce output on stderr, or writes its final output to stderr. Tests for variable validation conditions and pre/post conditions often elicit this behaviour. On Windows 10 and Python 3.9, this leads to a hang. Line 714 (in this PR) is a blocking operation that will never be satisfied given no further standard output will be observed.
This PR hacks around it when running on Windows by redirecting stderr to stdout. This truly is a hack, because later logic from line 724 onwards assumes `err` will contain stderr but will now always be empty. In practice, this seems to work on Windows OK.
A better solution might be to do something like https://stackoverflow.com/a/4896288. This pushes my limited python-fu.
* Fixed typo
* Fix linting errors
* Fix linting errors
---------
Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>1 parent a447abf commit 867c9e4
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
| 709 | + | |
709 | 710 | | |
710 | | - | |
| 711 | + | |
711 | 712 | | |
712 | 713 | | |
713 | 714 | | |
| |||
0 commit comments