[racket-dev] [plt] Push #25569: master branch updated

From: Neil Toronto (neil.toronto at gmail.com)
Date: Tue Oct 30 00:26:38 EDT 2012

On 10/29/2012 02:41 PM, Sam Tobin-Hochstadt wrote:
> This commit marks a few files that have intermittent failures as
> randomly failing, and possibly-more-controversially, removes the
> annotation from some genuinely random tests.  These tests, such as the
> random test for places, consistently succeed.

Does the annotation mean "this test uses randomness" or "this test has a 
practically nonzero probability of failing"?

Here are a couple of tests that use randomness but always succeed:

   (check-true ((+ (random) 1.0) . >= . 1.0))

   (check-true (let loop ()
                 (if (zero? (random 10)) #t (loop))))

Here's one that's more interesting because its probability of failure is 
nonzero (about 1/20^19):

   (check-false (= 0 (+ (random 65536)
                        (random 65536)
                        (random 65536)
                        (random 65536))))

Another way to restate my question is, should those tests be marked as 
random?

Neil ⊥


Posted on the dev mailing list.