Skip to content

Commit 339e563

Browse files
jrngitster
authored andcommitted
tests: skip terminal output tests on OS X
On Mac OS X 10.5.0, test_terminal gets stuck reading from the pty master every once in a while. To reproduce the problem: perl -MIO::Pty -MFile::Copy -e ' for (my $i = 0;; $i++) { my $master = new IO::Pty; my $slave = $master->slave; if (fork == 0) { close $master or die "close: $!"; open STDOUT, ">&", $slave or die "dup2: $!"; close $slave or die "close: $!"; exec("echo", "hi", $i) or die "exec: $!"; } close $slave or die "close: $!"; copy($master, \*STDOUT) or die "copy: $!"; close $master or die "close: $!"; wait; } ' It blocks after 7000 iterations or so in sysread(). The relevant sysread() call is the second call by the parent, which presumably executes before the child dies but after the parent has read all output from there. Since this is an intermitent problem, the quick check of terminal support in lib-terminal doesn't catch it. Skip these tests on the Mac for now. Noticed-by: Thomas Rast <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e674c17 commit 339e563

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

t/lib-terminal.sh

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
#!/bin/sh
22

3-
test_expect_success 'set up terminal for tests' '
4-
if
5-
test_have_prereq PERL &&
3+
test_expect_success PERL 'set up terminal for tests' '
4+
# Reading from the pty master seems to get stuck _sometimes_
5+
# on Mac OS X 10.5.0, using Perl 5.10.0 or 5.8.9.
6+
#
7+
# Reproduction recipe: run
8+
#
9+
# i=0
10+
# while ./test-terminal.perl echo hi $i
11+
# do
12+
# : $((i = $i + 1))
13+
# done
14+
#
15+
# After 2000 iterations or so it hangs.
16+
# https://rt.cpan.org/Ticket/Display.html?id=65692
17+
#
18+
if test "$(uname -s)" = Darwin
19+
then
20+
:
21+
elif
622
"$PERL_PATH" "$TEST_DIRECTORY"/test-terminal.perl \
723
sh -c "test -t 1 && test -t 2"
824
then

0 commit comments

Comments
 (0)