From 465c97ebf4421cdf5aadfb6bcb623da8c2d99e8a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 3 Apr 2012 10:52:27 +0100 Subject: parallel mount-local test: Don't run more than 12 threads. On the Koji builder that has lots of memory, this was trying to run something like 20 threads. --- ocaml/t/guestfs_500_parallel_mount_local.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ocaml/t/guestfs_500_parallel_mount_local.ml b/ocaml/t/guestfs_500_parallel_mount_local.ml index 974c8cc9..779afc1c 100644 --- a/ocaml/t/guestfs_500_parallel_mount_local.ml +++ b/ocaml/t/guestfs_500_parallel_mount_local.ml @@ -33,8 +33,11 @@ external _exit : int -> 'a = "ocaml_guestfs__exit" let total_time = 60. (* seconds, excluding launch *) let debug = true (* overview debugging messages *) let min_threads = 2 +let max_threads = 12 let mbytes_per_thread = 900 +let clip low high v = min high (max low v) + let rec main () = Random.self_init (); @@ -49,7 +52,8 @@ let rec main () = | _ -> None in match mbytes with | None -> min_threads (* default *) - | Some mbytes -> max min_threads (mbytes / mbytes_per_thread) in + | Some mbytes -> + clip min_threads max_threads (mbytes / mbytes_per_thread) in let threads = ref [] in for i = 1 to nr_threads do -- cgit