From 4b222ef18cc604eaa9f0c9e02e1b3bf89f0b408d Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Sat, 31 Aug 2013 10:17:18 +0400 Subject: [PATCH] slep-non-consing test: prevent from sleeping too much. Some platforms can't sleep for short amounts of time, add a sb-ext:with-timeout around it and don't report it as a failure, since there's basically nothing that can be fixed in such cases. --- tests/interface.pure.lisp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/interface.pure.lisp b/tests/interface.pure.lisp index 2612bf3..0979456 100644 --- a/tests/interface.pure.lisp +++ b/tests/interface.pure.lisp @@ -70,11 +70,13 @@ ;;; SLEEP should not cons except on 32-bit platforms when ;;; (> (mod seconds 1) (* most-positive-fixnum 1e-9)) (with-test (:name (sleep :non-consing) :fails-on :win32) - (ctu:assert-no-consing (sleep 0.00001s0)) - (locally (declare (notinline sleep)) - (ctu:assert-no-consing (sleep 0.00001s0)) - (ctu:assert-no-consing (sleep 0.00001d0)) - (ctu:assert-no-consing (sleep 1/100000003)))) + (handler-case (sb-ext:with-timeout 5 + (ctu:assert-no-consing (sleep 0.00001s0)) + (locally (declare (notinline sleep)) + (ctu:assert-no-consing (sleep 0.00001s0)) + (ctu:assert-no-consing (sleep 0.00001d0)) + (ctu:assert-no-consing (sleep 1/100000003)))) + (timeout ()))) ;;; Changes to make SLEEP cons less led to SLEEP ;;; not sleeping at all on 32-bit platforms when -- 1.7.10.4