{"thread":{"id":"37968","subject":"[PATCH v4] Allow TTY tests to run under recent Mac OS","startedAt":"2014-11-14T20:13:13Z","lastAt":"2014-11-15T00:14:21Z","messageCount":5,"participants":["Mike Blume","Junio C Hamano","Jonathan Nieder","John Szakmeister"],"isPatch":true,"patchVersion":4,"patchTotal":null},"messages":[{"id":"251907","messageId":"1415995993-70879-1-git-send-email-blume.mike@gmail.com","threadId":"37968","inReplyTo":null,"subject":"[PATCH v4] Allow TTY tests to run under recent Mac OS","fromName":"Mike Blume","fromEmail":"blume.mike@gmail.com","sentAt":"2014-11-14T20:13:13Z","receivedAt":"2014-11-14T20:13:13Z","isPatch":true,"sender":{"key":"blume.mike@gmail.com","avatar":"https://gravatar.com/avatar/1a7b440e1d942425ff4098ac7fc15b86b30cecaa56e1692a7ef8b5939ba25ea7?d=mp&s=160"},"body":"TTY tests were previously skipped on all Mac OS systems because of a\nbug where reading from pty master occasionally hung. This bug has since\nbeen found not to be reproducible under Mac OS 10.9 and 10.10.1.\n\nTherefore, run TTY tests under Mac OS 10.9 (Mavericks) and higher.\n\nSigned-off-by: Mike Blume <blume.mike@gmail.com>\nImproved-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\nImproved-by: John Szakmeister <john@szakmeister.net>\nImproved-by: Johannes Sixt <j6t@kdbg.org>\nImproved-by: Jeff King <peff@peff.net>\n---\n t/lib-terminal.sh | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/t/lib-terminal.sh b/t/lib-terminal.sh\nindex 5184549..275fb09 100644\n--- a/t/lib-terminal.sh\n+++ b/t/lib-terminal.sh\n@@ -29,7 +29,12 @@ test_lazy_prereq TTY '\n \t# After 2000 iterations or so it hangs.\n \t# https://rt.cpan.org/Ticket/Display.html?id=65692\n \t#\n-\ttest \"$(uname -s)\" != Darwin &&\n+\t# Under Mac OS X 10.9, this problem appears to be gone.\n+\t#\n+\t{\n+\t\ttest \"$(uname -s)\" != Darwin ||\n+\t\ttest \"$(uname -r | cut -d. -f1)\" -ge 13\n+\t} &&\n \n \tperl \"$TEST_DIRECTORY\"/test-terminal.perl \\\n \t\tsh -c \"test -t 1 && test -t 2\"\n-- \n2.2.0.rc1.197.g60bf093\n"},{"id":"251909","messageId":"xmqqbno9355t.fsf@gitster.dls.corp.google.com","threadId":"37968","inReplyTo":"1415995993-70879-1-git-send-email-blume.mike@gmail.com","subject":"Re: [PATCH v4] Allow TTY tests to run under recent Mac OS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-14T20:20:46Z","receivedAt":"2014-11-14T20:20:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mike Blume <blume.mike@gmail.com> writes:\n\n> TTY tests were previously skipped on all Mac OS systems because of a\n> bug where reading from pty master occasionally hung. This bug has since\n> been found not to be reproducible under Mac OS 10.9 and 10.10.1.\n>\n> Therefore, run TTY tests under Mac OS 10.9 (Mavericks) and higher.\n>\n> Signed-off-by: Mike Blume <blume.mike@gmail.com>\n> Improved-by: Junio C Hamano <gitster@pobox.com>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> Improved-by: John Szakmeister <john@szakmeister.net>\n> Improved-by: Johannes Sixt <j6t@kdbg.org>\n> Improved-by: Jeff King <peff@peff.net>\n> ---\n\nThe patch in this round looks good.  Will queue.\n\nThanks all who helped.\n\n>  t/lib-terminal.sh | 7 ++++++-\n>  1 file changed, 6 insertions(+), 1 deletion(-)\n>\n> diff --git a/t/lib-terminal.sh b/t/lib-terminal.sh\n> index 5184549..275fb09 100644\n> --- a/t/lib-terminal.sh\n> +++ b/t/lib-terminal.sh\n> @@ -29,7 +29,12 @@ test_lazy_prereq TTY '\n>  \t# After 2000 iterations or so it hangs.\n>  \t# https://rt.cpan.org/Ticket/Display.html?id=65692\n>  \t#\n> -\ttest \"$(uname -s)\" != Darwin &&\n> +\t# Under Mac OS X 10.9, this problem appears to be gone.\n> +\t#\n> +\t{\n> +\t\ttest \"$(uname -s)\" != Darwin ||\n> +\t\ttest \"$(uname -r | cut -d. -f1)\" -ge 13\n> +\t} &&\n>  \n>  \tperl \"$TEST_DIRECTORY\"/test-terminal.perl \\\n>  \t\tsh -c \"test -t 1 && test -t 2\"\n"},{"id":"251922","messageId":"20141114232106.GA6527@google.com","threadId":"37968","inReplyTo":"1415995993-70879-1-git-send-email-blume.mike@gmail.com","subject":"Re: [PATCH v4] Allow TTY tests to run under recent Mac OS","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-11-14T23:21:07Z","receivedAt":"2014-11-14T23:21:07Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nMike Blume wrote:\n\n> TTY tests were previously skipped on all Mac OS systems because of a\n> bug where reading from pty master occasionally hung. This bug has since\n> been found not to be reproducible under Mac OS 10.9 and 10.10.1.\n>\n> Therefore, run TTY tests under Mac OS 10.9 (Mavericks) and higher.\n\n*puzzled* Testing on Yosemite with the following script[1]\n\n\tperl -MIO::Pty -MFile::Copy -e '\n\t       for (my $i = 0;; $i++) {\n\t\t       my $master = new IO::Pty;\n\t\t       my $slave = $master->slave;\n\t\t       if (fork == 0) {\n\t\t\t       close $master or die \"close: $!\";\n\t\t\t       open STDOUT, \">&\", $slave or die \"dup2: $!\";\n\t\t\t       close $slave or die \"close: $!\";\n\t\t\t       exec(\"echo\", \"hi\", $i) or die \"exec: $!\";\n\t\t       }\n\t\t       close $slave or die \"close: $!\";\n\t\t       copy($master, \\*STDOUT) or die \"copy: $!\";\n\t\t       close $master or die \"close: $!\";\n\t\t       wait;\n\t       }\n\t'\n\nstill seems to hang eventually (after 61 iterations when my officemate\ntried it), reproducing the bug.\n\nDo you get a different result?\n\nThe bug was originally found in an autobuilder that would run the test\nsuite when new versions were pushed to check for regressions.  Even if\nthe hang only happened 0.1% of the time, that would get the\nautobuilder stuck after a while, which was how the problem got\nnoticed.\n\nThanks,\nJonathan\n\n[1] https://rt.cpan.org/Public/Bug/Display.html?id=65692\n"},{"id":"251923","messageId":"xmqqh9y11huv.fsf@gitster.dls.corp.google.com","threadId":"37968","inReplyTo":"20141114232106.GA6527@google.com","subject":"Re: [PATCH v4] Allow TTY tests to run under recent Mac OS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-14T23:29:28Z","receivedAt":"2014-11-14T23:29:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> *puzzled* Testing on Yosemite with the following script[1]\n> ...\n> still seems to hang eventually (after 61 iterations when my officemate\n> tried it), reproducing the bug.\n\nThanks.  I've merged it to 'next' and pushed out the result already,\nbut we may probably have to drop it.\n"},{"id":"251925","messageId":"CAEBDL5XHdRA1eqgEqdMV-HMA006XGcPQ+BVQgkhzhaGLErGwgw@mail.gmail.com","threadId":"37968","inReplyTo":"20141114232106.GA6527@google.com","subject":"Re: [PATCH v4] Allow TTY tests to run under recent Mac OS","fromName":"John Szakmeister","fromEmail":"john@szakmeister.net","sentAt":"2014-11-15T00:14:21Z","receivedAt":"2014-11-15T00:14:21Z","isPatch":true,"sender":{"key":"john@szakmeister.net","avatar":"https://avatars.githubusercontent.com/u/448087?v=4"},"body":"On Fri, Nov 14, 2014 at 6:21 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Hi,\n>\n> Mike Blume wrote:\n>\n>> TTY tests were previously skipped on all Mac OS systems because of a\n>> bug where reading from pty master occasionally hung. This bug has since\n>> been found not to be reproducible under Mac OS 10.9 and 10.10.1.\n>>\n>> Therefore, run TTY tests under Mac OS 10.9 (Mavericks) and higher.\n>\n> *puzzled* Testing on Yosemite with the following script[1]\n>\n>         perl -MIO::Pty -MFile::Copy -e '\n>                for (my $i = 0;; $i++) {\n>                        my $master = new IO::Pty;\n>                        my $slave = $master->slave;\n>                        if (fork == 0) {\n>                                close $master or die \"close: $!\";\n>                                open STDOUT, \">&\", $slave or die \"dup2: $!\";\n>                                close $slave or die \"close: $!\";\n>                                exec(\"echo\", \"hi\", $i) or die \"exec: $!\";\n>                        }\n>                        close $slave or die \"close: $!\";\n>                        copy($master, \\*STDOUT) or die \"copy: $!\";\n>                        close $master or die \"close: $!\";\n>                        wait;\n>                }\n>         '\n>\n> still seems to hang eventually (after 61 iterations when my officemate\n> tried it), reproducing the bug.\n>\n> Do you get a different result?\n\nInteresting.  It took quite a while, but it did finally fail on my\nMavericks box on the 115,140th iteration.\n\n> The bug was originally found in an autobuilder that would run the test\n> suite when new versions were pushed to check for regressions.  Even if\n> the hang only happened 0.1% of the time, that would get the\n> autobuilder stuck after a while, which was how the problem got\n> noticed.\n\nEek... that's nasty.\n\n-John\n"}]}