Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add test for randomized reqs-per-child

  • Loading branch information...
commit 31a7862b5debb8f521c10bc86d5abeeea756123e 1 parent c38d17b
@kazuho authored
Showing with 26 additions and 0 deletions.
  1. +26 −0 t/04-bumpy-life.t
View
26 t/04-bumpy-life.t
@@ -0,0 +1,26 @@
+use strict;
+use warnings;
+
+use Plack::Loader;
+use Test::More;
+use Test::TCP qw(empty_port);
+
+my $starlet = Plack::Loader->load(
+ 'Starlet',
+ min_reqs_per_child => 5,
+ max_reqs_per_child => 10,
+);
+
+my ($min, $max) = (7, 7);
+for (my $i = 0; $i < 10000; $i++) {
+ my $n = $starlet->_calc_reqs_per_child();
+ $min = $n
+ if $n < $min;
+ $max = $n
+ if $n > $max;
+}
+
+is $min, 5, "min";
+is $max, 10, "max";
+
+done_testing;
Please sign in to comment.
Something went wrong with that request. Please try again.