Guys,

Okay, so I found a bug in this test script for a module I recently
took over.  It's a test that generates random times, and it would fail
for zero seconds.  But it only happened every once in a while, since
zero was only one possible value and it was only running a small(ish)
number of tests.  So I fixed that, but then it occurred to me that I
had no way to guarantee that I was validating every possible random
value, so then I thought I'd run 10x as many tests as there were
possible values.  But of course that takes forever, so I decided to
only run that many tests when $AUTOMATED_TESTING == 1.  (I also
switched it over to using done_testing() so I wouldn't have to count
all the tests.)  Ran the tests, both with $AUTOMATED_TESTING on and
off, everything looked good, popped it off to CPAN.

Now I'm getting failures from _some_ CPAN Testers ... actually it
fails more often than it succeeds, but it _does_ succeed sometimes.
The errors I get are varied, but they seem to fall into a few basic
categories:

> t/rand_time.t      (Wstat: 9 Tests: 1764021 Failed: 0)
>   Non-zero wait status: 9

> *** Signal 9

> t/rand_time.t      (Wstat: 139 Tests: 996881 Failed: 0)
>   Non-zero wait status: 139
>   Parse errors: No plan found in TAP output

> Out of memory!
> Segmentation Fault - core dumped
> make: *** [test_dynamic] Error 139

Now, that last one about running out of memory made me wonder if I'm
leaking memory somewhere.  So I tried testing memory size (using GTop)
throughout the first loop and reporting every time it changes.  What I
discovered is that calling ok() actually sucks up some memory ... but
only sometimes.  I've put the output down at the bottom of the email.
But I can't really tell if this is the source of the problem, or just
a red herring.  Do note, though, that I'm currently only monitoring
the first loop, whereas there are actually several (although the first
loop is the biggest one, since the other loops test with a min and/or
max possible time).

If you want to see the CPAN Testers results for yourself, go here:
http://www.cpantesters.org/distro/D/Data-Random.html, switch it to
Dist Maturity: Dev Only, and look at the latest dev release (0.05_04).

Anyone have any suggestions for me?


            -- Buddy


mem changed from 41.211Mb to 41.340Mb at bottom of loop, iteration 102
mem changed from 41.340Mb to 41.469Mb at bottom of loop, iteration 287
mem changed from 41.469Mb to 41.598Mb at bottom of loop, iteration 483
mem changed from 41.598Mb to 41.727Mb at bottom of loop, iteration 681
mem changed from 41.727Mb to 41.855Mb at bottom of loop, iteration 885
mem changed from 41.855Mb to 41.984Mb at bottom of loop, iteration 1067
mem changed from 41.984Mb to 42.113Mb at bottom of loop, iteration 1269
mem changed from 42.113Mb to 42.242Mb at bottom of loop, iteration 1463
mem changed from 42.242Mb to 42.371Mb at bottom of loop, iteration 1658
mem changed from 42.371Mb to 42.500Mb at bottom of loop, iteration 1854
mem changed from 42.500Mb to 42.656Mb at bottom of loop, iteration 2047
mem changed from 42.656Mb to 42.785Mb at bottom of loop, iteration 2263
mem changed from 42.785Mb to 42.914Mb at bottom of loop, iteration 2464
mem changed from 42.914Mb to 43.043Mb at bottom of loop, iteration 2665
mem changed from 43.043Mb to 43.172Mb at bottom of loop, iteration 2857
mem changed from 43.172Mb to 43.301Mb at bottom of loop, iteration 3059
mem changed from 43.301Mb to 43.430Mb at bottom of loop, iteration 3252
mem changed from 43.430Mb to 43.559Mb at bottom of loop, iteration 3455
mem changed from 43.559Mb to 43.688Mb at bottom of loop, iteration 3652
mem changed from 43.688Mb to 43.816Mb at bottom of loop, iteration 3848
mem changed from 43.816Mb to 43.945Mb at bottom of loop, iteration 4047
mem changed from 43.945Mb to 44.074Mb at bottom of loop, iteration 4166
mem changed from 44.074Mb to 44.203Mb at bottom of loop, iteration 4389
mem changed from 44.203Mb to 44.332Mb at bottom of loop, iteration 4591
mem changed from 44.332Mb to 44.461Mb at bottom of loop, iteration 4781
mem changed from 44.461Mb to 44.590Mb at bottom of loop, iteration 4979
mem changed from 44.590Mb to 44.719Mb at bottom of loop, iteration 5182
mem changed from 44.719Mb to 44.848Mb at bottom of loop, iteration 5379
mem changed from 44.848Mb to 44.977Mb at bottom of loop, iteration 5575

Reply via email to