1.0.47.12: robustify test for bug-654289
authorNikodemus Siivola <nikodemus@random-state.net>
Thu, 7 Apr 2011 12:53:32 +0000 (12:53 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Thu, 7 Apr 2011 12:53:32 +0000 (12:53 +0000)
  Run GC before timing the compilation, so that garbage from earlier
  tests doesn't get accounted here.

  Up the fixed leeway to 1/10th of a second -- if we have a real
  regression the expected blowup is several seconds or tens of
  seconds.

  Also make the error message report the times for easier eyeballing
  of future failures.

tests/compiler.pure.lisp
version.lisp-expr

index c8d09ac..57191fc 100644 (file)
   ;; Test that compile-times don't explode when quoted constants
   ;; get big.
   (labels ((time-n (n)
+             (gc :full t) ; Let's not confuse the issue with GC            
              (let* ((tree (make-tree (expt 10 n) nil))
                     (t0 (get-internal-run-time))
                     (f (compile nil `(lambda (x) (eq x (quote ,tree)))))
            (max-small (reduce #'max times :end 3))
            (max-big (reduce #'max times :start 3)))
       ;; This way is hopefully fairly CPU-performance insensitive.
-      (assert (> (* (+ 2 max-small) 2) max-big)))))
+      (unless (> (+ (truncate internal-time-units-per-second 10)
+                    (* 2 max-small))
+                 max-big)
+        (error "Bad scaling or test? ~S" times)))))
 
 (with-test (:name :bug-309063)
   (let ((fun (compile nil `(lambda (x)
index cecdaba..9f9c427 100644 (file)
@@ -20,4 +20,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.47.11"
+"1.0.47.12"