Wait for compile-time logs to be processed before running optimizer tests.
This should solve the log ordering problems that caused non-deterministic test failures during the nightly builds.
This commit is contained in:
parent
84e2880715
commit
37ba3672d4
|
@ -1,5 +1,5 @@
|
||||||
#lang racket
|
#lang racket
|
||||||
(require racket/runtime-path
|
(require racket/runtime-path compiler/compiler
|
||||||
rackunit rackunit/text-ui
|
rackunit rackunit/text-ui
|
||||||
typed-racket/optimizer/logging)
|
typed-racket/optimizer/logging)
|
||||||
|
|
||||||
|
@ -7,19 +7,21 @@
|
||||||
test-opt test-missed-optimization test-file?
|
test-opt test-missed-optimization test-file?
|
||||||
generate-log tests-dir missed-optimizations-dir)
|
generate-log tests-dir missed-optimizations-dir)
|
||||||
|
|
||||||
|
(define comp (compile-zos #f #:module? #t))
|
||||||
|
|
||||||
(define (generate-log name dir)
|
(define (generate-log name dir)
|
||||||
;; some tests require other tests, so some fiddling is required
|
;; some tests require other tests, so some fiddling is required
|
||||||
|
(define f (build-path dir name))
|
||||||
(with-output-to-string
|
(with-output-to-string
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(with-tr-logging-to-port
|
(with-tr-logging-to-port
|
||||||
(current-output-port)
|
(current-output-port)
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
(comp (list f) 'auto)))
|
||||||
(parameterize
|
(parameterize
|
||||||
([current-namespace (make-base-empty-namespace)]
|
([current-namespace (make-base-empty-namespace)]
|
||||||
[current-load-relative-directory dir])
|
[current-load-relative-directory dir])
|
||||||
(dynamic-require
|
(dynamic-require f #f)))))
|
||||||
(build-path (current-load-relative-directory) name)
|
|
||||||
#f)))))))
|
|
||||||
|
|
||||||
;; we log optimizations and compare to an expected log to make sure that all
|
;; we log optimizations and compare to an expected log to make sure that all
|
||||||
;; the optimizations we expected did indeed happen
|
;; the optimizations we expected did indeed happen
|
||||||
|
|
Loading…
Reference in New Issue
Block a user