From 59da3bd83e6e7b57a7b1b886339a165d47fad076 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 23 Jul 2014 11:06:46 +0100 Subject: [PATCH] meta/pkg-build/thread: fix test Add synchronization so that the enumerated interleavings cover all of the ones that should be possible. Using `(sync (system-idle-evt))` as a barrier works as long as the implementation of the library being tested doesn't itself use `(sync (system-idle-evt))`. That seems like a safe-enough assumption for a test. --- pkgs/plt-services/meta/pkg-build/thread.rkt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/plt-services/meta/pkg-build/thread.rkt b/pkgs/plt-services/meta/pkg-build/thread.rkt index 8876769b2a..e005fb41d5 100644 --- a/pkgs/plt-services/meta/pkg-build/thread.rkt +++ b/pkgs/plt-services/meta/pkg-build/thread.rkt @@ -108,7 +108,7 @@ (printf "hi\n") (eprintf "bye\n") (flush-chunk-output) - (sleep) + (sync (system-idle-evt)) (printf "HI\n") (eprintf "BYE\n")))) (define t2 (thread/chunk-output @@ -116,7 +116,7 @@ (printf "hola\n") (eprintf "adios\n") (flush-chunk-output) - (sleep) + (sync (system-idle-evt)) (printf "HOLA\n") (eprintf "ADIOS\n")))) (wait-chunk-output))