       (is (= {:value 1} @context-to-fn)))
     (testing "Duration has ordered values"
       (is (> (count @duration-distribution) 10))
-      (is (= (sort @duration-distribution) @duration-distribution)))))
-
+      (is-approximately-sorted? @duration-distribution))))
 
 (deftest with-2-arity-rate-function
   (let [rate-function-called? (atom false)

      (is (every? #(and (>= % 0.0) (<= % 1.0)) @progress-distribution))
      (is #{0.1} @progress-distribution)
      (is #{1.0} @progress-distribution)
      (is (= (sort @progress-distribution) @progress-distribution)))))

(deftest with-1-arity-rate-function
  (let [rate-function-called? (atom false)

      (is (every? #(and (>= % 0.0) (<= % 1.0)) @progress-distribution))
      (is #{0.1} @progress-distribution)
      (is #{1.0} @progress-distribution)
      (is-approximately-sorted? @progress-distribution))))

(deftest with-1-arity-concurrency-function
  (let [concurrency-function-called? (atom false)
