commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <phil.ste...@gmail.com>
Subject Re: svn commit: r1088315 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java
Date Sun, 03 Apr 2011 16:21:22 GMT
On 4/3/11 7:33 AM, luc@apache.org wrote:
> Author: luc
> Date: Sun Apr  3 14:33:00 2011
> New Revision: 1088315
>
> URL: http://svn.apache.org/viewvc?rev=1088315&view=rev
> Log:
> allow 3 retries for testNextHex which is expected to randomly fail with low probability
Why not just change this to use a fixed seed?  That would actually
probably be better from a bug sensitivity standpoint, as bumping
this to 3 retries makes the effective alpha for the chisquare test
10E-9.

To make these tests use a fixed seed, we just need to introduce a
setUp and explicitly seed the RandomDataImpl's generator using its
reSeed method.

Phil
> Modified:
>     commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java
>
> Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java?rev=1088315&r1=1088314&r2=1088315&view=diff
> ==============================================================================
> --- commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java
(original)
> +++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java
Sun Apr  3 14:33:00 2011
> @@ -22,6 +22,7 @@ import java.util.HashSet;
>  import java.util.List;
>  
>  
> +import org.apache.commons.math.Retry;
>  import org.apache.commons.math.RetryRunner;
>  import org.apache.commons.math.TestUtils;
>  import org.apache.commons.math.distribution.BetaDistributionImpl;
> @@ -395,6 +396,7 @@ public class RandomDataTest {
>  
>      /** test dispersion and failure modes for nextHex() */
>      @Test
> +    @Retry(3)
>      public void testNextHex() {
>          try {
>              randomData.nextHexString(-1);
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message