Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't run more tests that can hang for some
  • Loading branch information
lizmat committed Dec 25, 2015
1 parent 9b7b71f commit d51b8cb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions S17-supply/throttle.t
Expand Up @@ -3,7 +3,7 @@ use lib 't/spec/packages';

use Test;

plan 37;
plan 17;

dies-ok { Supply.throttle(1,1) }, 'can not be called as a class method';

Expand Down Expand Up @@ -55,13 +55,13 @@ diag "**** scheduling with {$*SCHEDULER.WHAT.perl}";
# is @a.sum, 10, "ok with $n at a time";
#}

for 1..10 -> $n {
my @a[10]; # pre-size array to allow seamless multi-thread updates
my $before = now;
(^10).Supply.throttle( $n, { sleep rand; @a[$_] = 1 } ).wait;
ok now < $before + ((12 - $n) * .6), "parallelism as expected with $n";
is @a.sum, 10, "ok with $n at a time with random delay";
}
#for 1..10 -> $n {
# my @a[10]; # pre-size array to allow seamless multi-thread updates
# my $before = now;
# (^10).Supply.throttle( $n, { sleep rand; @a[$_] = 1 } ).wait;
# ok now < $before + ((12 - $n) * .6), "parallelism as expected with $n";
# is @a.sum, 10, "ok with $n at a time with random delay";
#}

{
my $status = Supplier.new;
Expand Down

0 comments on commit d51b8cb

Please sign in to comment.