From 6fd8f4bf08a9619aa53802c428b62283e5104f3f Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 25 Jul 2015 20:38:12 -0600 Subject: [PATCH] fix test for module cache The test didn't retain a relevant namespace, so the test could fail due to GC timing. --- pkgs/racket-test-core/tests/racket/module.rktl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/racket-test-core/tests/racket/module.rktl b/pkgs/racket-test-core/tests/racket/module.rktl index 8c71368351..2384ca4427 100644 --- a/pkgs/racket-test-core/tests/racket/module.rktl +++ b/pkgs/racket-test-core/tests/racket/module.rktl @@ -1329,7 +1329,7 @@ case of module-leve bindings; it doesn't cover local bindings. (delete-file zo-path)) ;; Check that module-code caching works -(let () +(let ([saved-namespace #f]) (define dir (find-system-path 'temp-dir)) (define tmx (build-path dir "tmx2.rkt")) (define e (compile '(module tmx2 racket/kernel @@ -1366,7 +1366,10 @@ case of module-leve bindings; it doesn't cover local bindings. (test 2 add1 (parameterize ([current-namespace (make-base-namespace)]) (dynamic-require tmx 'x))) - (delete-file zo-path)) + (delete-file zo-path) + + ;; Need to retain the namespace until here + (set! saved-namespace first-namespace)) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Check that `provide` doesn't run enclosed expanders until within a