File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
web/test-integration/immutant/web Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 179
179
(is (= (str " /" path)
180
180
(-> result (deref 5000 " nil" ) read-string :path-info )))))))
181
181
182
+ (let [serializer (java.util.concurrent.Executors/newSingleThreadExecutor )]
183
+ (defn mark [& msg]
184
+ (let [^Runnable r #(apply println
185
+ (.format (java.text.SimpleDateFormat. " HH:mm:ss,SSS" )
186
+ (java.util.Date. )) msg)]
187
+ (.submit serializer r))))
188
+
182
189
(deftest concurrent-ws-requests-should-not-cross-streams
183
190
(replace-handler
184
191
'(fn [request]
192
199
client-count 40 ]
193
200
(dotimes [n client-count]
194
201
(future
202
+ (mark " CLIENT SEND" n)
195
203
(let [client (ws/connect (str (cdef-url " ws" ) " ?x=" n)
196
204
:on-receive (fn [m]
205
+ (mark " CLIENT RCVD" m)
197
206
(swap! results conj m)
198
207
(when (= client-count (count @results))
199
208
(deliver done? true ))))]
200
209
(swap! clients conj client))))
201
210
(is (deref done? 10000 nil ))
202
- (println " RESULTS" @results)
211
+ (mark " RESULTS" @results)
203
212
(is (= (->> client-count (range 0 ) (map str) set)
204
213
(set @results)))
205
214
(doseq [client @clients]
You can’t perform that action at this time.
0 commit comments