storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [42/47] storm git commit: Let users override default test timeout
Date Wed, 12 Nov 2014 16:45:43 GMT
Let users override default test timeout

* Fixed (bug) / Added time-ms from tracked-wait (trackedWait)
* Provide a method to override default test timeout
* Add a way to specify default test timeout in ms to DEVELOPER.md


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/356f9f8b
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/356f9f8b
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/356f9f8b

Branch: refs/heads/security
Commit: 356f9f8b6e986d5e9113ade5a80a228d15b7bc86
Parents: f880d61
Author: Jungtaek Lim <kabhwan@gmail.com>
Authored: Thu Nov 6 07:20:24 2014 +0900
Committer: Jungtaek Lim <kabhwan@gmail.com>
Committed: Thu Nov 6 07:20:24 2014 +0900

----------------------------------------------------------------------
 DEVELOPER.md                                    | 4 ++++
 storm-core/src/clj/backtype/storm/testing.clj   | 6 ++++--
 storm-core/src/clj/backtype/storm/testing4j.clj | 3 +++
 3 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/356f9f8b/DEVELOPER.md
----------------------------------------------------------------------
diff --git a/DEVELOPER.md b/DEVELOPER.md
index 81a4122..b6c0b84 100644
--- a/DEVELOPER.md
+++ b/DEVELOPER.md
@@ -229,6 +229,10 @@ The following commands must be run from the top-level directory.
     # Build the code and run the tests (requires nodejs, python and ruby installed) 
     $ mvn clean install
 
+    # Build the code and run the tests, with specifying default test timeout (in millisecond)
+    $ export STORM_TEST_TIMEOUT_MS=10000
+    $ mvn clean install
+
     # Build the code but skip the tests
     $ mvn clean install -DskipTests=true
 

http://git-wip-us.apache.org/repos/asf/storm/blob/356f9f8b/storm-core/src/clj/backtype/storm/testing.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/testing.clj b/storm-core/src/clj/backtype/storm/testing.clj
index 798dccc..1ea1227 100644
--- a/storm-core/src/clj/backtype/storm/testing.clj
+++ b/storm-core/src/clj/backtype/storm/testing.clj
@@ -187,7 +187,9 @@
       ;; on windows, the host process still holds lock on the logfile
       (catch Exception e (log-message (.getMessage e)))) ))
 
-(def TEST-TIMEOUT-MS 5000)
+(def TEST-TIMEOUT-MS
+  (let [timeout (System/getenv "STORM_TEST_TIMEOUT_MS")]
+    (parse-int (if timeout timeout "5000"))))
 
 (defmacro while-timeout [timeout-ms condition & body]
   `(let [end-time# (+ (System/currentTimeMillis) ~timeout-ms)]
@@ -594,7 +596,7 @@
                            (not= (global-amt track-id "transferred")                    
            
                                  (global-amt track-id "processed"))
                            ))]
-        (while-timeout TEST-TIMEOUT-MS (waiting?)
+        (while-timeout timeout-ms (waiting?)
                        ;; (println "Spout emitted: " (global-amt track-id "spout-emitted"))
                        ;; (println "Processed: " (global-amt track-id "processed"))
                        ;; (println "Transferred: " (global-amt track-id "transferred"))

http://git-wip-us.apache.org/repos/asf/storm/blob/356f9f8b/storm-core/src/clj/backtype/storm/testing4j.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/testing4j.clj b/storm-core/src/clj/backtype/storm/testing4j.clj
index ff939a9..9f89698 100644
--- a/storm-core/src/clj/backtype/storm/testing4j.clj
+++ b/storm-core/src/clj/backtype/storm/testing4j.clj
@@ -44,6 +44,7 @@
              ^:static [mkTrackedTopology [backtype.storm.ILocalCluster backtype.storm.generated.StormTopology]
backtype.storm.testing.TrackedTopology]
              ^:static [trackedWait [backtype.storm.testing.TrackedTopology] void]
              ^:static [trackedWait [backtype.storm.testing.TrackedTopology Integer] void]
+             ^:static [trackedWait [backtype.storm.testing.TrackedTopology Integer Integer]
void]
              ^:static [advanceClusterTime [backtype.storm.ILocalCluster Integer Integer]
void]
              ^:static [advanceClusterTime [backtype.storm.ILocalCluster Integer] void]
              ^:static [multiseteq [java.util.Collection java.util.Collection] boolean]
@@ -123,6 +124,8 @@
       (TrackedTopology.)))
 
 (defn -trackedWait
+  ([^TrackedTopology trackedTopology ^Integer amt ^Integer timeout-ms]
+   (tracked-wait trackedTopology amt timeout-ms))
   ([^TrackedTopology trackedTopology ^Integer amt]
    (tracked-wait trackedTopology amt))
   ([^TrackedTopology trackedTopology]


Mime
View raw message