Merge branch 'local-hostname-conf' of https://github.com/yieldbot/storm into STORM-546-V1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2691fb7..1fa3bb7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## 0.9.3-rc2
+ * STORM-492: Test timeout should be configurable
  * STORM-540: Change default time format in logs to ISO8601 in order to include timezone
  * STORM-511: Storm-Kafka spout keeps sending fetch requests with invalid offset
  * STORM-538: Guava com.google.thirdparty.publicsuffix is not shaded
diff --git a/DEVELOPER.md b/DEVELOPER.md
index 4af1e3c..b6c0b84 100644
--- a/DEVELOPER.md
+++ b/DEVELOPER.md
@@ -230,7 +230,8 @@
     $ mvn clean install
 
     # Build the code and run the tests, with specifying default test timeout (in millisecond)
-    $ mvn clean install -DSTORM_TEST_TIMEOUT_MS=10000
+    $ export STORM_TEST_TIMEOUT_MS=10000
+    $ mvn clean install
 
     # Build the code but skip the tests
     $ mvn clean install -DskipTests=true
diff --git a/LICENSE b/LICENSE
index e30786b..2c7adb3 100644
--- a/LICENSE
+++ b/LICENSE
@@ -206,7 +206,19 @@
 
 For jQuery 1.6.2 (storm-core/src/ui/public/js/jquery-1.6.2.min.js)
 
-Copyright (c) 2009 John Resig, http://jquery.com/
+jQuery JavaScript Library v1.6.2
+http://jquery.com/
+
+Copyright 2011, John Resig
+Dual licensed under the MIT or GPL Version 2 licenses.
+http://jquery.org/license
+
+Includes Sizzle.js
+http://sizzlejs.com/
+Copyright 2011, The Dojo Foundation
+Released under the MIT, BSD, and GPL Licenses.
+
+MIT license selected:
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
diff --git a/storm-core/src/clj/backtype/storm/testing.clj b/storm-core/src/clj/backtype/storm/testing.clj
index 79d3277..1ea1227 100644
--- a/storm-core/src/clj/backtype/storm/testing.clj
+++ b/storm-core/src/clj/backtype/storm/testing.clj
@@ -188,7 +188,7 @@
       (catch Exception e (log-message (.getMessage e)))) ))
 
 (def TEST-TIMEOUT-MS
-  (let [timeout (System/getProperty "STORM_TEST_TIMEOUT_MS")]
+  (let [timeout (System/getenv "STORM_TEST_TIMEOUT_MS")]
     (parse-int (if timeout timeout "5000"))))
 
 (defmacro while-timeout [timeout-ms condition & body]
diff --git a/storm-core/src/clj/backtype/storm/testing4j.clj b/storm-core/src/clj/backtype/storm/testing4j.clj
index 7790b6b..9f89698 100644
--- a/storm-core/src/clj/backtype/storm/testing4j.clj
+++ b/storm-core/src/clj/backtype/storm/testing4j.clj
@@ -125,7 +125,7 @@
 
 (defn -trackedWait
   ([^TrackedTopology trackedTopology ^Integer amt ^Integer timeout-ms]
-    (tracked-wait trackedTopology amt timeout-ms))
+   (tracked-wait trackedTopology amt timeout-ms))
   ([^TrackedTopology trackedTopology ^Integer amt]
    (tracked-wait trackedTopology amt))
   ([^TrackedTopology trackedTopology]
diff --git a/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java b/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
index fed684e..c516b63 100644
--- a/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
+++ b/storm-core/src/jvm/backtype/storm/messaging/netty/Client.java
@@ -142,6 +142,8 @@
             }
 
             int tried = 0;
+            //setting channel to null to make sure we throw an exception when reconnection fails
+            channel = null;
             while (tried <= max_retries) {
 
                 LOG.info("Reconnect started for {}... [{}]", name(), tried);
diff --git a/storm-core/test/clj/backtype/storm/messaging/netty_unit_test.clj b/storm-core/test/clj/backtype/storm/messaging/netty_unit_test.clj
index ea7b8dc..ed5797d 100644
--- a/storm-core/test/clj/backtype/storm/messaging/netty_unit_test.clj
+++ b/storm-core/test/clj/backtype/storm/messaging/netty_unit_test.clj
@@ -20,15 +20,15 @@
 
 (bootstrap)
 
-(def port 6700) 
-(def task 1) 
+(def port 6700)
+(def task 1)
 
 (deftest test-basic
   (let [req_msg (String. "0123456789abcdefghijklmnopqrstuvwxyz")
         storm-conf {STORM-MESSAGING-TRANSPORT "backtype.storm.messaging.netty.Context"
                     STORM-MESSAGING-NETTY-BUFFER-SIZE 1024
                     STORM-MESSAGING-NETTY-MAX-RETRIES 10
-                    STORM-MESSAGING-NETTY-MIN-SLEEP-MS 1000 
+                    STORM-MESSAGING-NETTY-MIN-SLEEP-MS 1000
                     STORM-MESSAGING-NETTY-MAX-SLEEP-MS 5000
                     STORM-MESSAGING-NETTY-SERVER-WORKER-THREADS 1
                     STORM-MESSAGING-NETTY-CLIENT-WORKER-THREADS 1
@@ -43,14 +43,14 @@
     (is (= req_msg (String. (.message resp))))
     (.close client)
     (.close server)
-    (.term context)))    
+    (.term context)))
 
 (deftest test-large-msg
-  (let [req_msg (apply str (repeat 2048000 'c')) 
+  (let [req_msg (apply str (repeat 2048000 'c'))
         storm-conf {STORM-MESSAGING-TRANSPORT "backtype.storm.messaging.netty.Context"
                     STORM-MESSAGING-NETTY-BUFFER-SIZE 102400
                     STORM-MESSAGING-NETTY-MAX-RETRIES 10
-                    STORM-MESSAGING-NETTY-MIN-SLEEP-MS 1000 
+                    STORM-MESSAGING-NETTY-MIN-SLEEP-MS 1000
                     STORM-MESSAGING-NETTY-MAX-SLEEP-MS 5000
                     STORM-MESSAGING-NETTY-SERVER-WORKER-THREADS 1
                     STORM-MESSAGING-NETTY-CLIENT-WORKER-THREADS 1
@@ -65,21 +65,21 @@
     (is (= req_msg (String. (.message resp))))
     (.close client)
     (.close server)
-    (.term context)))    
-    
+    (.term context)))
+
 (deftest test-server-delayed
     (let [req_msg (String. "0123456789abcdefghijklmnopqrstuvwxyz")
        storm-conf {STORM-MESSAGING-TRANSPORT "backtype.storm.messaging.netty.Context"
                     STORM-MESSAGING-NETTY-BUFFER-SIZE 1024
                     STORM-MESSAGING-NETTY-MAX-RETRIES 10
-                    STORM-MESSAGING-NETTY-MIN-SLEEP-MS 1000 
+                    STORM-MESSAGING-NETTY-MIN-SLEEP-MS 1000
                     STORM-MESSAGING-NETTY-MAX-SLEEP-MS 5000
                     STORM-MESSAGING-NETTY-SERVER-WORKER-THREADS 1
                     STORM-MESSAGING-NETTY-CLIENT-WORKER-THREADS 1
                     }
         context (TransportFactory/makeContext storm-conf)
         client (.connect context nil "localhost" port)
-        
+
         server (Thread.
                 (fn []
                   (Thread/sleep 1000)
@@ -88,7 +88,7 @@
                         resp (.next iter)]
                     (is (= task (.task resp)))
                     (is (= req_msg (String. (.message resp))))
-                    (.close server) 
+                    (.close server)
                   )))
         _ (.start server)
         _ (.send client task (.getBytes req_msg))
@@ -101,7 +101,7 @@
   (let [storm-conf {STORM-MESSAGING-TRANSPORT "backtype.storm.messaging.netty.Context"
                     STORM-MESSAGING-NETTY-BUFFER-SIZE 1024000
                     STORM-MESSAGING-NETTY-MAX-RETRIES 10
-                    STORM-MESSAGING-NETTY-MIN-SLEEP-MS 1000 
+                    STORM-MESSAGING-NETTY-MIN-SLEEP-MS 1000
                     STORM-MESSAGING-NETTY-MAX-SLEEP-MS 5000
                     STORM-MESSAGING-NETTY-SERVER-WORKER-THREADS 1
                     STORM-MESSAGING-NETTY-CLIENT-WORKER-THREADS 1
@@ -112,7 +112,7 @@
     (doseq [num  (range 1 100000)]
       (let [req_msg (str num)]
         (.send client task (.getBytes req_msg))))
-    
+
     (let [resp (ArrayList.)
           received (atom 0)]
       (while (< @received (- 100000 1))
@@ -126,7 +126,7 @@
       (let [req_msg (str num)
             resp_msg (String. (.message (.get resp (- num 1))))]
         (is (= req_msg resp_msg)))))
-   
+
     (.close client)
     (.close server)
     (.term context)))
diff --git a/storm-dist/binary/LICENSE b/storm-dist/binary/LICENSE
index 5ad9e5d..1a8c4a8 100644
--- a/storm-dist/binary/LICENSE
+++ b/storm-dist/binary/LICENSE
@@ -245,10 +245,21 @@
 
 -----------------------------------------------------------------------
 
-
 For jQuery 1.6.2 (storm-core/src/ui/public/js/jquery-1.6.2.min.js)
 
-Copyright (c) 2009 John Resig, http://jquery.com/
+jQuery JavaScript Library v1.6.2
+http://jquery.com/
+
+Copyright 2011, John Resig
+Dual licensed under the MIT or GPL Version 2 licenses.
+http://jquery.org/license
+
+Includes Sizzle.js
+http://sizzlejs.com/
+Copyright 2011, The Dojo Foundation
+Released under the MIT, BSD, and GPL Licenses.
+
+MIT license selected:
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the