From 612b7adaa7a80a0a0bf178f6a61e30308a59f4f9 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 28 Nov 2023 08:17:26 -0700 Subject: [PATCH] improve some tests that have been unreliable (#767) A `compute-size-increments` test has been a long-time problem. It turns out that it was failing randomly due to a random list of symbols stashed in a thread parameter by an earlier test; sometimes, one of those symbols can reach a lot of data. The solution here is to not count data reachable from thread parameters. A `cost-center-time` test has been failing on very slow machines. As a timing test, it's inherently unreliable, but turning up the limit should make failures rare enough without making the test useless. --- mats/misc.ms | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mats/misc.ms b/mats/misc.ms index 4a3d6fda2..a8771ce4b 100644 --- a/mats/misc.ms +++ b/mats/misc.ms @@ -1160,7 +1160,13 @@ (pause-until (lambda () (eq? 'done (unbox ready)))) (pause-until (lambda () (= 1 (#%$top-level-value '$active-threads)))) ;; Get thread's size, which shouldn't include bstr - (let ([post-sizes (compute-size-increments (list th-code th))]) + (let ([post-sizes (compute-size-increments (list th-code + th + ;; don't count parameters towards te thread's + ;; size; in particluar, the `$tt-fat` parameter + ;; from a "thread.ms" test can have random symbols, + ;; some of which may be bound to large values + (#%$tc-field 'parameters (#%$tc))))]) (printf "SIZES ~s\n" (list pre-sizes N post-sizes)) (mutex-release m) ;; Wait for thread to exit @@ -2672,7 +2678,10 @@ ((lambda (x) (and (time