Skip to content

Commit

Permalink
Fix an issue with leiningen's tests on Windows.
Browse files Browse the repository at this point in the history
Deleting one of the jar files in the sample test project
was failing on Windows, which was causing all sorts of hard to debug
test errors.

Calling System/gc seems to do the trick (at least on Vista),
but it is not really a proper solution.
If anybody has a better idea, please speak up.
  • Loading branch information
mtyaka committed Jun 30, 2011
1 parent 93a8e5e commit 3867f97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/leiningen/test/deps.clj
Expand Up @@ -50,7 +50,12 @@
(let [rel-repo-snaps-dep (assoc pr :dependencies [clj-time])]
(is (thrown? Exception (with-no-log (deps rel-repo-snaps-dep))))))
(finally
(delete-file-recursively (file (:root sample-project) "lib")))))
;; Without triggering the GC, joda jar cannot be deleted on
;; Windows, which causes all sorts of seemingly unrelated test
;; failures. If anybody knows how to fix this properly, please do
;; it.
(System/gc)
(delete-file-recursively (file (:root sample-project) "lib")))))

(deftest test-native-deps
(delete-file-recursively (:library-path native-project) true)
Expand Down

0 comments on commit 3867f97

Please sign in to comment.