Skip to content

Commit

Permalink
Added test for async bug
Browse files Browse the repository at this point in the history
  • Loading branch information
vrurg committed Jun 8, 2019
1 parent 163f0a0 commit b9ad5fd
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions t/02-rakudo/15-gh_1202.t
@@ -0,0 +1,26 @@
use v6;
use Test;

# GH#1202

plan 2;

my Bool $complete = False;

await Promise.anyof(
start {
my $out = "";
# This was a bug with unpredictable output. Hopefully 50 repetiotions is enough to make sure everything works.
for 1..50 -> $rep {
my $proc = run $*EXECUTABLE, '-MTest', '-e', q<await (^5).map({start { print qqx{echo $_} } })>, :out;
$out ~= $proc.out.slurp;
}
like $out, /[ <[0..4]> \n ] ** 250/, "shell output";
$complete = True;
},
Promise.in(600), # 10mins timeout
);

ok $complete, "all runs completed";

# vim: ft=perl6 sw=4

0 comments on commit b9ad5fd

Please sign in to comment.