Skip to content

Commit 18f036d

Browse files
authored
[test] Align behavior of interrupts.test on different platforms (#68556)
The test llvm/Support/interrupts.test behaves differently on Linux and Windows. On Linux the function 'run_wrapper' runs process with stderr connected to pipe, while on Windows stderr is mapped to stderr of the running script. When no output was made to stderr, this difference was not observable. The new version of llvm-symbolizer (https://reviews.llvm.org/D149759) complains about missing binary file, so stderr is not empty anymore and the test fails on Windows and passes on Linux.
1 parent 3e5187e commit 18f036d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

llvm/test/Support/interrupts.test

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import sys
1010
import time
1111

1212
def run_symbolizer():
13-
proc = subprocess.Popen([sys.argv[2]], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
13+
proc = subprocess.Popen([sys.argv[2]], stdout=subprocess.PIPE,
14+
stdin=subprocess.PIPE, stderr=sys.stderr)
1415
# Write then read some output to ensure the process has started fully.
1516
proc.stdin.write(b'foo bar\n')
1617
proc.stdin.flush()
@@ -29,13 +30,10 @@ def run_wrapper():
2930
if os.name == 'nt':
3031
startupinfo = subprocess.STARTUPINFO()
3132
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
32-
proc = subprocess.Popen(args,
33-
stderr=sys.stderr,
34-
startupinfo=startupinfo,
35-
creationflags=subprocess.CREATE_NEW_CONSOLE)
33+
subprocess.run(args, stderr=sys.stderr, startupinfo=startupinfo,
34+
creationflags=subprocess.CREATE_NEW_CONSOLE)
3635
else:
37-
proc = subprocess.Popen(args,
38-
stderr=subprocess.PIPE)
36+
subprocess.run(args, stderr=sys.stderr)
3937

4038
if sys.argv[1] == 'wrapper':
4139
run_wrapper()

0 commit comments

Comments
 (0)