On 4/3/11 7:33 AM, l...@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-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org