Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test output should not be buffered even for non-TTYs (prove -j 8 …) #6515

Open
p6rt opened this issue Sep 17, 2017 · 4 comments
Open

Test output should not be buffered even for non-TTYs (prove -j 8 …) #6515

p6rt opened this issue Sep 17, 2017 · 4 comments
Labels
exotictest regression Issue did not exist previously testneeded

Comments

@p6rt
Copy link

p6rt commented Sep 17, 2017

Migrated from rt.perl.org#132108 (status was 'open')

Searchable as RT132108$

@p6rt
Copy link
Author

p6rt commented Sep 17, 2017

From @AlexDaniel

When I'm running prove with more than one job (-j) I'm expecting to see the progress continuously. However, after the recent buffering change all you can see in prove is this​:
===( 4;0 1/? 1/? 1/? 1/? )====================================^

In other words, 4 files are running but you can't see how many tests were done in each.

Compare it with output like this​:

===( 27;4 8/? 9/? 4/? 6/? )====================================

**How to replicate​:**

Create 8 files like this​:

use Test;
for ^20 {
  sleep rand;
  is 42, 42, â��42 is 42â��;
}
done-testing;

Now run it with​:

$ prove -j 4 --exec=perl6 t/

It can be â��fixedâ�� with a crude patch like this​:

Inline Patch
diff --git a/lib/Test.pm6 b/lib/Test.pm6
index ea4176a40..8ef52b9d0 100644
--- a/lib/Test.pm6
+++ b/lib/Test.pm6
@@ -39,6 +39,8 @@ my int $done_testing_has_been_run = 0;
 _init_vars();
 
 sub _init_io {
+    nqp::setbuffersizefh(nqp::getstdin(),  0);
+    nqp::setbuffersizefh(nqp::getstdout(), 0);
     $output         = $PROCESS::OUT;
     $failure_output = $PROCESS::ERR;
$todo_output = $PROCESS::OUT;

But is there any better way to do it?

See also​:
* rakudo/rakudo@4b02b8a
* RT #​132030 https://rt-archive.perl.org/perl6/Ticket/Display.html?id=132030

@p6rt
Copy link
Author

p6rt commented Sep 17, 2017

From @coke

See https://rt.cpan.org/Public/Bug/Display.html?id=108390 which was mentioned here​:

https://irclog.perlgeek.de/perl6/2017-09-13#i_15159739
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Sep 17, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Sep 17, 2017

From @AlexDaniel

The change was made in rakudo/rakudo#1160

See also​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=132111
On 2017-09-16 21​:06​:03, coke wrote​:

See https://rt.cpan.org/Public/Bug/Display.html?id=108390 which was
mentioned here​:

https://irclog.perlgeek.de/perl6/2017-09-13#i_15159739

@p6rt p6rt added exotictest regression Issue did not exist previously testneeded labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exotictest regression Issue did not exist previously testneeded
Projects
None yet
Development

No branches or pull requests

1 participant