diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-04-03 10:52:27 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-04-03 10:52:27 +0100 |
commit | 465c97ebf4421cdf5aadfb6bcb623da8c2d99e8a (patch) | |
tree | 536c0821d9cdb34ece6b53c0d72122a673b3538e | |
parent | 999aac63eb9652e07a828d801feb691ce6d9d17b (diff) | |
download | libguestfs-465c97ebf4421cdf5aadfb6bcb623da8c2d99e8a.tar.gz libguestfs-465c97ebf4421cdf5aadfb6bcb623da8c2d99e8a.tar.xz libguestfs-465c97ebf4421cdf5aadfb6bcb623da8c2d99e8a.zip |
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.
-rw-r--r-- | ocaml/t/guestfs_500_parallel_mount_local.ml | 6 |
1 files changed, 5 insertions, 1 deletions
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 |