Skip to content

Commit

Permalink
Change ceiling test to be deterministic
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Dagit committed Feb 20, 2013
1 parent 169bae4 commit 7b7617f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions test/clj/backtype/storm/util_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
(deftest test-new-curator-uses-exponential-backoff
(let [expected_interval 2400
expected_retries 10
expected_ceiling 5000
expected_ceiling (/ expected_interval 2)
conf (merge (clojurify-structure (Utils/readDefaultConfig))
{Config/STORM_ZOOKEEPER_RETRY_INTERVAL expected_interval
Config/STORM_ZOOKEEPER_RETRY_TIMES expected_retries
Expand All @@ -23,11 +23,6 @@
(is (= (.getBaseSleepTimeMs retry) expected_interval))
(is (= (.getN retry) expected_retries))
(is (= (.getMaxRetryInterval retry) expected_ceiling))
; It would be very unlikely for this to fail three times.
(is (or
(= (.getSleepTimeMs retry 10 0) expected_ceiling)
(= (.getSleepTimeMs retry 10 0) expected_ceiling)
(= (.getSleepTimeMs retry 10 0) expected_ceiling)
))
(is (= (.getSleepTimeMs retry 10 0) expected_ceiling))
)
)

0 comments on commit 7b7617f

Please sign in to comment.