From 09a51a9b358ee6218467d3c3ab55b224c3bc046a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 26 Jul 2012 08:47:06 -0600 Subject: [PATCH] fix a `subprocess' test Merge to v5.3 (cherry picked from commit 8c10dc15792112ef7c60be56376e6b473ae12d89) --- collects/tests/racket/subprocess.rktl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/collects/tests/racket/subprocess.rktl b/collects/tests/racket/subprocess.rktl index 49685c3069..5661042d0f 100644 --- a/collects/tests/racket/subprocess.rktl +++ b/collects/tests/racket/subprocess.rktl @@ -388,7 +388,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (let ([try - (lambda (post-shutdown) + (lambda (post-shutdown wait?) (let ([c (make-custodian)]) (let ([l (parameterize ([current-custodian c]) (process* self @@ -397,13 +397,16 @@ (test 'running (list-ref l 4) 'status) (custodian-shutdown-all c) (sleep 0.1) + (when (and wait? + (eq? post-shutdown 'done-error)) + ((list-ref l 4) 'wait)) (test post-shutdown (list-ref l 4) 'status) ((list-ref l 4) 'kill))))]) - (try 'running) + (try 'running #f) (parameterize ([current-subprocess-custodian-mode 'kill]) - (try 'done-error)) + (try 'done-error #f)) (parameterize ([current-subprocess-custodian-mode 'interrupt]) - (try (if (eq? 'windows (system-type)) 'running 'done-error)))) + (try (if (eq? 'windows (system-type)) 'running 'done-error) #t))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; process groups