File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 30
30
and `:line`."
31
31
nil )
32
32
33
+
34
+ (def REQUIRE_LOCK (Object. ))
35
+
33
36
(defn add-desc [testable description]
34
37
(assoc testable ::desc
35
38
(str (name (::id testable)) " (" description " )" )))
36
39
37
40
(defn- try-require [n]
38
41
(try
39
- (require n)
42
+ (locking REQUIRE_LOCK
43
+ (require n))
40
44
true
41
45
(catch java.io.FileNotFoundException e
42
46
false )))
48
52
(try-require (symbol (name type)))))
49
53
50
54
51
- (defn- try -assert-spec [type testable n]
55
+ (defn- retry -assert-spec [type testable n]
52
56
(let [ result (try (assert-spec type testable) (catch Exception _e false ))]
53
57
(if (or result (<= n 1 )) result
54
- (try -assert-spec type testable (dec n))) ; otherwise, retry
58
+ (retry -assert-spec type testable (dec n))) ; otherwise, retry
55
59
))
56
60
57
61
(defn- load-type+validate
67
71
(let [type (::type testable)]
68
72
(try-load-third-party-lib type)
69
73
(try
70
- (try- assert-spec type testable 3 )
74
+ (assert-spec type testable)
71
75
(catch Exception e
72
76
(output/warn (format " Could not load %s. This is a known bug in parallelization.\n %s" type e))))))
73
77
284
288
(println (:parallel *config*) \space (.getName (Thread/currentThread )))
285
289
(future
286
290
; (do #_(println "Firing off future!" (Thread/currentThread)) )
287
- (binding [*config* (dissoc *config* :parallel )] (try- run-testable % test-plan 3 ))))
291
+ (binding [*config* (dissoc *config* :parallel )] (run-testable % test-plan))))
288
292
testables))]
289
293
(comment (loop [result [] ; (ArrayBlockingQueue. 1024)
290
294
[test & testables] testables]
You can’t perform that action at this time.
0 commit comments