Ignore random testing running out of resources.

Evaluating random bignum expressions sometimes goes off the rails.
This commit is contained in:
Vincent St-Amour 2015-10-06 11:44:19 -05:00
parent ca46d80189
commit 98f90cce2c
2 changed files with 16 additions and 14 deletions

View File

@ -39,7 +39,6 @@
(define test-timeouts
'(("optimizer/run.rkt" 1200)
("run.rkt" 1800)
("tr-random-testing.rkt" 300)
("with-tr-contracts.rkt" 1500)))

View File

@ -236,19 +236,22 @@
(printf "seed: ~s~n" seed)
(flush-output) ; DrDr doesn't print the above if the testing segfaults.
(call-with-limits
#f max-mem
(lambda ()
;; start with 1000 small, deterministic test cases, to catch regressions
(redex-check tr-arith E #:in-order (check-all-reals (term E))
#:attempts 1000
#:prepare exp->real-exp
#:keep-going? #t)
;; then switch to purely random to get different ones every run
(redex-check tr-arith E #:ad-hoc (check-all-reals (term E))
#:attempts n-attempts
#:prepare exp->real-exp
#:keep-going? #t)))
;; because some of the generated expressions comute gigantic bignums, running
;; out of resources is expected, so just ignore that case
(with-handlers ([exn:fail:resource? values])
(call-with-limits
300 max-mem
(lambda ()
;; start with 1000 small, deterministic test cases, to catch regressions
(redex-check tr-arith E #:in-order (check-all-reals (term E))
#:attempts 1000
#:prepare exp->real-exp
#:keep-going? #t)
;; then switch to purely random to get different ones every run
(redex-check tr-arith E #:ad-hoc (check-all-reals (term E))
#:attempts n-attempts
#:prepare exp->real-exp
#:keep-going? #t))))
(printf "bad tests (usually typechecking failed): ~v~n" num-exceptions)