clojurewerkz / titanium

Clojure graph library built on top of Titan
106 stars 20 forks source link

the last clear-db call always fails (for me) #20

Closed ghost closed 10 years ago

ghost commented 11 years ago

this one: https://github.com/clojurewerkz/titanium/blob/master/test/clojurewerkz/titanium/edges_test.clj#L243

it's almost as if, the shutdown isn't finished or something else isn't closed and keeps using (some) files

;; Clojure 1.5.1
;; Switching to clojurewerkz.titanium.edges-test namespace
#'clojurewerkz.titanium.edges-test/test-edges
#<Namespace clojurewerkz.titanium.edges-test>
=> (run-tests)

Testing clojurewerkz.titanium.edges-test

ERROR in (test-edges) (FileUtils.java:1643)
Uncaught exception, not in assertion.
expected: nil
  actual: java.io.IOException: Unable to delete file: \tmp\titanium-test\data\system\schema_keyspaces\system-schema_keyspaces-ib-2-Index.db
 at org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1643)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)

clojurewerkz.titanium.conf$clear_db.invoke (conf.clj:20)
    clojurewerkz.titanium.edges_test/fn (edges_test.clj:243)
    clojure.test$test_var$fn__7145.invoke (test.clj:701)
    clojure.test$test_var.invoke (test.clj:701)
    clojure.test$test_all_vars$fn__7149$fn__7156.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars$fn__7149.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars.invoke (test.clj:713)
    clojure.test$test_ns.invoke (test.clj:736)
    clojure.core$map$fn__4207.invoke (core.clj:2487)
    clojure.lang.LazySeq.sval (LazySeq.java:42)
    clojure.lang.LazySeq.seq (LazySeq.java:60)
    clojure.lang.Cons.next (Cons.java:39)
    clojure.lang.RT.boundedLength (RT.java:1654)
    clojure.lang.RestFn.applyTo (RestFn.java:130)
    clojure.core$apply.invoke (core.clj:619)
    clojure.test$run_tests.doInvoke (test.clj:751)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.test$run_tests.invoke
 (test.clj:749)
    clojurewerkz.titanium.edges_test$eval3003.invoke (NO_SOURCE_FILE:1)
    clojure.lang.Compiler.eval (Compiler.java:6619)
    clojure.lang.Compiler.eval (Compiler.java:6582)
    clojure.core$eval.invoke (core.clj:2852)
    clojure.main$repl$read_eval_print__6588$fn__6591.invoke (main.clj:259)
    clojure.main$repl$read_eval_print__6588.invoke (main.clj:259)
    clojure.main$repl$fn__6597.invoke (main.clj:277)
    clojure.main$repl.doInvoke (main.clj:277)
    clojure.lang.RestFn.invoke (RestFn.java:1096)
    clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__588.invoke (interruptible_eval.clj:56)
    clojure.lang.AFn.applyToHelper (AFn.java:159)
    clojure.lang.AFn.applyTo (AFn.java:151)
    clojure.core$apply.invoke (core.clj:617)
    clojure.core$with_bindings_STAR_.doInvoke (core.clj:1788)
    clojure.lang.RestFn.invoke (RestFn.java:425)
    clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke (interruptible_eval.clj:41)
    clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__629$fn__632.invoke
 (interruptible_eval.clj:171)
    clojure.core$comp$fn__4154.invoke (core.clj:2330)
    clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__622.invoke (interruptible_eval.clj:138)
    clojure.lang.AFn.run (AFn.java:24)
    java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:615)
    java.lang.Thread.run (Thread.java:722)

Ran 1 tests containing 56 assertions.
0 failures, 1 errors.
{:type :summary, :pass 55, :test 1, :error 1, :fail 0}
zmaril commented 11 years ago

What operating system are you on? In which environment are you running the tests? I've had problems running tests at the REPL before. BerkeleyDB will often refuse to remove a vertex in the REPL because a lock expires. I've never had these problems running with lein test though. I think there is some persistent state in Titan somewhere that messes up shutdowns from within Clojure, but I haven't tried to dive in and find it.

michaelklishin commented 11 years ago

I suspect it's on Windows.

ghost commented 11 years ago

yes it's win7 64bit ccw+eclipse I am not using lein test though, just Ctrl+Alt+L on the file in editor edges_test.clj and just issue (run-tests) at REPL

ok i just try lein test

s:\workspace.eclipse.2k13_2\titanium>lein test
\nlein test clojurewerkz.titanium.conf
\nlein test clojurewerkz.titanium.edges-test
MemoryMeter uninitialized (jamm not specified as java agent); KeyCache size in JVM Heap will not be calculated accurately. Usually this mean
s cassandra-env.sh disabled jamm because you are using a buggy JRE; upgrade to the Sun JRE instead
No host ID found, created bdddd722-8436-4c16-ad93-03987020c060 (Note: This should happen exactly once per node).
Generated random token [-9216748387219656796]. Random tokens will result in an unbalanced ring; see http://wiki.apache.org/cassandra/Operati
ons
\nlein test :only clojurewerkz.titanium.edges-test/test-edges

ERROR in (test-edges) (FileUtils.java:1643)
Uncaught exception, not in assertion.
expected: nil
  actual: java.io.IOException: Unable to delete file: \tmp\titanium-test\data\system\schema_keyspaces\system-schema_keyspaces-ib-2-Index.db
 at org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1643)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    clojurewerkz.titanium.conf$clear_db.invoke (conf.clj:20)
    clojurewerkz.titanium.edges_test/fn (edges_test.clj:243)
    clojure.test$test_var$fn__7145.invoke (test.clj:701)
    clojure.test$test_var.invoke (test.clj:701)
    user$eval83$test_var_with_selector__92.invoke (NO_SOURCE_FILE:1)
    clojure.lang.AFn.applyToHelper (AFn.java:163)
    clojure.lang.AFn.applyTo (AFn.java:151)
    clojure.core$apply.invoke (core.clj:619)
    leiningen.core.injected$compose_hooks$fn__15.doInvoke (NO_SOURCE_FILE:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:617)
    leiningen.core.injected$run_hooks.invoke (NO_SOURCE_FILE:1)
    leiningen.core.injected$prepare_for_hooks$fn__20$fn__21.doInvoke (NO_SOURCE_FILE:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.test$test_all_vars$fn__7149$fn__7156.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars$fn__7149.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars.invoke (test.clj:713)
    clojure.test$test_ns.invoke (test.clj:736)
    clojure.core$map$fn__4207.invoke (core.clj:2487)
    clojure.lang.LazySeq.sval (LazySeq.java:42)
    clojure.lang.LazySeq.seq (LazySeq.java:60)
    clojure.lang.Cons.next (Cons.java:39)
    clojure.lang.RT.boundedLength (RT.java:1654)
    clojure.lang.RestFn.applyTo (RestFn.java:130)
    clojure.core$apply.invoke (core.clj:619)
    clojure.test$run_tests.doInvoke (test.clj:751)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:617)
    user$eval83$fn__149.invoke (NO_SOURCE_FILE:1)
    user$eval83.invoke (NO_SOURCE_FILE:1)
    clojure.lang.Compiler.eval (Compiler.java:6619)
    clojure.lang.Compiler.eval (Compiler.java:6609)
    clojure.lang.Compiler.eval (Compiler.java:6582)
    clojure.core$eval.invoke (core.clj:2852)
    clojure.main$eval_opt.invoke (main.clj:308)
    clojure.main$initialize.invoke (main.clj:327)
    clojure.main$null_opt.invoke (main.clj:362)
    clojure.main$main.doInvoke (main.clj:440)
    clojure.lang.RestFn.invoke (RestFn.java:421)
    clojure.lang.Var.invoke (Var.java:419)
    clojure.lang.AFn.applyToHelper (AFn.java:163)
    clojure.lang.Var.applyTo (Var.java:532)
    clojure.main.main (main.java:37)
\nlein test clojurewerkz.titanium.element-test
\nlein test :only clojurewerkz.titanium.element-test/element-test

ERROR in (element-test) (FileUtils.java:1643)
Uncaught exception, not in assertion.
expected: nil
  actual: java.io.IOException: Unable to delete file: \tmp\titanium-test\data\system\schema_keyspaces\system-schema_keyspaces-ib-2-Index.db
 at org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1643)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    clojurewerkz.titanium.conf$clear_db.invoke (conf.clj:20)
    clojurewerkz.titanium.element_test/fn (element_test.clj:10)
    clojure.test$test_var$fn__7145.invoke (test.clj:701)
    clojure.test$test_var.invoke (test.clj:701)
    user$eval83$test_var_with_selector__92.invoke (NO_SOURCE_FILE:1)
    clojure.lang.AFn.applyToHelper (AFn.java:163)
    clojure.lang.AFn.applyTo (AFn.java:151)
    clojure.core$apply.invoke (core.clj:619)
    leiningen.core.injected$compose_hooks$fn__15.doInvoke (NO_SOURCE_FILE:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:617)
    leiningen.core.injected$run_hooks.invoke (NO_SOURCE_FILE:1)
    leiningen.core.injected$prepare_for_hooks$fn__20$fn__21.doInvoke (NO_SOURCE_FILE:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.test$test_all_vars$fn__7149$fn__7156.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars$fn__7149.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars.invoke (test.clj:713)
    clojure.test$test_ns.invoke (test.clj:736)
    clojure.core$map$fn__4207.invoke (core.clj:2487)
    clojure.lang.LazySeq.sval (LazySeq.java:42)
    clojure.lang.LazySeq.seq (LazySeq.java:60)
    clojure.lang.Cons.next (Cons.java:39)
    clojure.lang.RT.next (RT.java:598)
    clojure.core$next.invoke (core.clj:64)
    clojure.core$reduce1.invoke (core.clj:896)
    clojure.core$reduce1.invoke (core.clj:887)
    clojure.core$merge_with.doInvoke (core.clj:2702)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.core$apply.invoke (core.clj:619)
    clojure.test$run_tests.doInvoke (test.clj:751)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:617)
    user$eval83$fn__149.invoke (NO_SOURCE_FILE:1)
    user$eval83.invoke (NO_SOURCE_FILE:1)
    clojure.lang.Compiler.eval (Compiler.java:6619)
    clojure.lang.Compiler.eval (Compiler.java:6609)
    clojure.lang.Compiler.eval (Compiler.java:6582)
    clojure.core$eval.invoke (core.clj:2852)
    clojure.main$eval_opt.invoke (main.clj:308)
    clojure.main$initialize.invoke (main.clj:327)
    clojure.main$null_opt.invoke (main.clj:362)
    clojure.main$main.doInvoke (main.clj:440)
    clojure.lang.RestFn.invoke (RestFn.java:421)
    clojure.lang.Var.invoke (Var.java:419)
    clojure.lang.AFn.applyToHelper (AFn.java:163)
    clojure.lang.Var.applyTo (Var.java:532)
    clojure.main.main (main.java:37)
\nlein test clojurewerkz.titanium.graph-test
\nlein test :only clojurewerkz.titanium.graph-test/test-conf-graph

ERROR in (test-conf-graph) (FileUtils.java:1643)
Uncaught exception, not in assertion.
expected: nil
  actual: java.io.IOException: Unable to delete file: \tmp\titanium-test\data\system\schema_keyspaces\system-schema_keyspaces-ib-2-Index.db
 at org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1643)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    clojurewerkz.titanium.conf$clear_db.invoke (conf.clj:20)
    clojurewerkz.titanium.graph_test/fn (graph_test.clj:35)
    clojure.test$test_var$fn__7145.invoke (test.clj:701)
    clojure.test$test_var.invoke (test.clj:701)
    user$eval83$test_var_with_selector__92.invoke (NO_SOURCE_FILE:1)
    clojure.lang.AFn.applyToHelper (AFn.java:163)
    clojure.lang.AFn.applyTo (AFn.java:151)
    clojure.core$apply.invoke (core.clj:619)
    leiningen.core.injected$compose_hooks$fn__15.doInvoke (NO_SOURCE_FILE:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:617)
    leiningen.core.injected$run_hooks.invoke (NO_SOURCE_FILE:1)
    leiningen.core.injected$prepare_for_hooks$fn__20$fn__21.doInvoke (NO_SOURCE_FILE:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.test$test_all_vars$fn__7149$fn__7156.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars$fn__7149.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars.invoke (test.clj:713)
    clojure.test$test_ns.invoke (test.clj:736)
    clojure.core$map$fn__4207.invoke (core.clj:2487)
    clojure.lang.LazySeq.sval (LazySeq.java:42)
    clojure.lang.LazySeq.seq (LazySeq.java:60)
    clojure.lang.Cons.next (Cons.java:39)
    clojure.lang.RT.next (RT.java:598)
    clojure.core$next.invoke (core.clj:64)
    clojure.core$reduce1.invoke (core.clj:896)
    clojure.core$reduce1.invoke (core.clj:887)
    clojure.core$merge_with.doInvoke (core.clj:2702)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.core$apply.invoke (core.clj:619)
    clojure.test$run_tests.doInvoke (test.clj:751)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:617)
    user$eval83$fn__149.invoke (NO_SOURCE_FILE:1)
    user$eval83.invoke (NO_SOURCE_FILE:1)
    clojure.lang.Compiler.eval (Compiler.java:6619)
    clojure.lang.Compiler.eval (Compiler.java:6609)
    clojure.lang.Compiler.eval (Compiler.java:6582)
    clojure.core$eval.invoke (core.clj:2852)
    clojure.main$eval_opt.invoke (main.clj:308)
    clojure.main$initialize.invoke (main.clj:327)
    clojure.main$null_opt.invoke (main.clj:362)
    clojure.main$main.doInvoke (main.clj:440)
    clojure.lang.RestFn.invoke (RestFn.java:421)
    clojure.lang.Var.invoke (Var.java:419)
    clojure.lang.AFn.applyToHelper (AFn.java:163)
    clojure.lang.Var.applyTo (Var.java:532)
    clojure.main.main (main.java:37)
\nlein test clojurewerkz.titanium.integration-test
\nlein test :only clojurewerkz.titanium.integration-test/test-integration-example1

ERROR in (test-integration-example1) (FileUtils.java:1643)
Uncaught exception, not in assertion.
expected: nil
  actual: java.io.IOException: Unable to delete file: \tmp\titanium-test\data\system\schema_keyspaces\system-schema_keyspaces-ib-2-Index.db
 at org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1643)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    clojurewerkz.titanium.conf$clear_db.invoke (conf.clj:20)
    clojurewerkz.titanium.integration_test/fn (integration_test.clj:12)
    clojure.test$test_var$fn__7145.invoke (test.clj:701)
    clojure.test$test_var.invoke (test.clj:701)
    user$eval83$test_var_with_selector__92.invoke (NO_SOURCE_FILE:1)
    clojure.lang.AFn.applyToHelper (AFn.java:163)
    clojure.lang.AFn.applyTo (AFn.java:151)
    clojure.core$apply.invoke (core.clj:619)
    leiningen.core.injected$compose_hooks$fn__15.doInvoke (NO_SOURCE_FILE:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:617)
    leiningen.core.injected$run_hooks.invoke (NO_SOURCE_FILE:1)
    leiningen.core.injected$prepare_for_hooks$fn__20$fn__21.doInvoke (NO_SOURCE_FILE:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.test$test_all_vars$fn__7149$fn__7156.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars$fn__7149.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars.invoke (test.clj:713)
    clojure.test$test_ns.invoke (test.clj:736)
    clojure.core$map$fn__4207.invoke (core.clj:2487)
    clojure.lang.LazySeq.sval (LazySeq.java:42)
    clojure.lang.LazySeq.seq (LazySeq.java:60)
    clojure.lang.Cons.next (Cons.java:39)
    clojure.lang.RT.next (RT.java:598)
    clojure.core$next.invoke (core.clj:64)
    clojure.core$reduce1.invoke (core.clj:896)
    clojure.core$reduce1.invoke (core.clj:887)
    clojure.core$merge_with.doInvoke (core.clj:2702)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.core$apply.invoke (core.clj:619)
    clojure.test$run_tests.doInvoke (test.clj:751)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:617)
    user$eval83$fn__149.invoke (NO_SOURCE_FILE:1)
    user$eval83.invoke (NO_SOURCE_FILE:1)
    clojure.lang.Compiler.eval (Compiler.java:6619)
    clojure.lang.Compiler.eval (Compiler.java:6609)
    clojure.lang.Compiler.eval (Compiler.java:6582)
    clojure.core$eval.invoke (core.clj:2852)
    clojure.main$eval_opt.invoke (main.clj:308)
    clojure.main$initialize.invoke (main.clj:327)
    clojure.main$null_opt.invoke (main.clj:362)
    clojure.main$main.doInvoke (main.clj:440)
    clojure.lang.RestFn.invoke (RestFn.java:421)
    clojure.lang.Var.invoke (Var.java:419)
    clojure.lang.AFn.applyToHelper (AFn.java:163)
    clojure.lang.Var.applyTo (Var.java:532)
    clojure.main.main (main.java:37)
\nlein test clojurewerkz.titanium.types-test
\nlein test :only clojurewerkz.titanium.types-test/test-types

ERROR in (test-types) (FileUtils.java:1643)
Uncaught exception, not in assertion.
expected: nil
  actual: java.io.IOException: Unable to delete file: \tmp\titanium-test\data\system\schema_keyspaces\system-schema_keyspaces-ib-2-Index.db
 at org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1643)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    clojurewerkz.titanium.conf$clear_db.invoke (conf.clj:20)
    clojurewerkz.titanium.types_test/fn (types_test.clj:10)
    clojure.test$test_var$fn__7145.invoke (test.clj:701)
    clojure.test$test_var.invoke (test.clj:701)
    user$eval83$test_var_with_selector__92.invoke (NO_SOURCE_FILE:1)
    clojure.lang.AFn.applyToHelper (AFn.java:163)
    clojure.lang.AFn.applyTo (AFn.java:151)
    clojure.core$apply.invoke (core.clj:619)
    leiningen.core.injected$compose_hooks$fn__15.doInvoke (NO_SOURCE_FILE:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:617)
    leiningen.core.injected$run_hooks.invoke (NO_SOURCE_FILE:1)
    leiningen.core.injected$prepare_for_hooks$fn__20$fn__21.doInvoke (NO_SOURCE_FILE:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.test$test_all_vars$fn__7149$fn__7156.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars$fn__7149.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars.invoke (test.clj:713)
    clojure.test$test_ns.invoke (test.clj:736)
    clojure.core$map$fn__4207.invoke (core.clj:2487)
    clojure.lang.LazySeq.sval (LazySeq.java:42)
    clojure.lang.LazySeq.seq (LazySeq.java:60)
    clojure.lang.Cons.next (Cons.java:39)
    clojure.lang.RT.next (RT.java:598)
    clojure.core$next.invoke (core.clj:64)
    clojure.core$reduce1.invoke (core.clj:896)
    clojure.core$reduce1.invoke (core.clj:887)
    clojure.core$merge_with.doInvoke (core.clj:2702)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.core$apply.invoke (core.clj:619)
    clojure.test$run_tests.doInvoke (test.clj:751)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:617)
    user$eval83$fn__149.invoke (NO_SOURCE_FILE:1)
    user$eval83.invoke (NO_SOURCE_FILE:1)
    clojure.lang.Compiler.eval (Compiler.java:6619)
    clojure.lang.Compiler.eval (Compiler.java:6609)
    clojure.lang.Compiler.eval (Compiler.java:6582)
    clojure.core$eval.invoke (core.clj:2852)
    clojure.main$eval_opt.invoke (main.clj:308)
    clojure.main$initialize.invoke (main.clj:327)
    clojure.main$null_opt.invoke (main.clj:362)
    clojure.main$main.doInvoke (main.clj:440)
    clojure.lang.RestFn.invoke (RestFn.java:421)
    clojure.lang.Var.invoke (Var.java:419)
    clojure.lang.AFn.applyToHelper (AFn.java:163)
    clojure.lang.Var.applyTo (Var.java:532)
    clojure.main.main (main.java:37)
\nlein test clojurewerkz.titanium.vertices-test
\nlein test :only clojurewerkz.titanium.vertices-test/vertex-test

ERROR in (vertex-test) (FileUtils.java:1643)
Uncaught exception, not in assertion.
expected: nil
  actual: java.io.IOException: Unable to delete file: \tmp\titanium-test\data\system\schema_keyspaces\system-schema_keyspaces-ib-2-Index.db
 at org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1643)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1634)
    org.apache.commons.io.FileUtils.cleanDirectory (FileUtils.java:1268)
    org.apache.commons.io.FileUtils.deleteDirectory (FileUtils.java:1200)
    clojurewerkz.titanium.conf$clear_db.invoke (conf.clj:20)
    clojurewerkz.titanium.vertices_test/fn (vertices_test.clj:12)
    clojure.test$test_var$fn__7145.invoke (test.clj:701)
    clojure.test$test_var.invoke (test.clj:701)
    user$eval83$test_var_with_selector__92.invoke (NO_SOURCE_FILE:1)
    clojure.lang.AFn.applyToHelper (AFn.java:163)
    clojure.lang.AFn.applyTo (AFn.java:151)
    clojure.core$apply.invoke (core.clj:619)
    leiningen.core.injected$compose_hooks$fn__15.doInvoke (NO_SOURCE_FILE:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:617)
    leiningen.core.injected$run_hooks.invoke (NO_SOURCE_FILE:1)
    leiningen.core.injected$prepare_for_hooks$fn__20$fn__21.doInvoke (NO_SOURCE_FILE:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.test$test_all_vars$fn__7149$fn__7156.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars$fn__7149.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars.invoke (test.clj:713)
    clojure.test$test_ns.invoke (test.clj:736)
    clojure.core$map$fn__4207.invoke (core.clj:2487)
    clojure.lang.LazySeq.sval (LazySeq.java:42)
    clojure.lang.LazySeq.seq (LazySeq.java:60)
    clojure.lang.Cons.next (Cons.java:39)
    clojure.lang.RT.next (RT.java:598)
    clojure.core$next.invoke (core.clj:64)
    clojure.core$reduce1.invoke (core.clj:896)
    clojure.core$reduce1.invoke (core.clj:887)
    clojure.core$merge_with.doInvoke (core.clj:2702)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.core$apply.invoke (core.clj:619)
    clojure.test$run_tests.doInvoke (test.clj:751)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:617)
    user$eval83$fn__149.invoke (NO_SOURCE_FILE:1)
    user$eval83.invoke (NO_SOURCE_FILE:1)
    clojure.lang.Compiler.eval (Compiler.java:6619)
    clojure.lang.Compiler.eval (Compiler.java:6609)
    clojure.lang.Compiler.eval (Compiler.java:6582)
    clojure.core$eval.invoke (core.clj:2852)
    clojure.main$eval_opt.invoke (main.clj:308)
    clojure.main$initialize.invoke (main.clj:327)
    clojure.main$null_opt.invoke (main.clj:362)
    clojure.main$main.doInvoke (main.clj:440)
    clojure.lang.RestFn.invoke (RestFn.java:421)
    clojure.lang.Var.invoke (Var.java:419)
    clojure.lang.AFn.applyToHelper (AFn.java:163)
    clojure.lang.Var.applyTo (Var.java:532)
    clojure.main.main (main.java:37)

Ran 8 tests containing 63 assertions.
0 failures, 6 errors.
Tests failed.
s:\workspace.eclipse.2k13_2\titanium>
zmaril commented 11 years ago

I haven't used windows as a developer before. My first guess is that this is a permission issue. Can you give \tmp\titanium-test the correct permissions for windows and see if that helps?

ghost commented 11 years ago

I am pretty sure that it's because some files are still in use because I can only delete it manually when I kill the java.exe (from inside ccw, java.exe is still alive while in REPL), the tmp folder is basically empty initially (the clear-db call works at first call before tg/open) and the tg/open does fill the titanium-test folder with about 60+MB but the deletion fails after shutdown, and unless I kill java.exe (the REPL) I cannot delete the folder.

Am I to understand that this doesn't happen on *nix ?

=> (clear-db)
   (tg/open conf)
nil
=> (tg/shutdown)
   (clear-db)
#<StandardTitanGraph titangraph[embeddedcassandra:null]>
nil
IOException Unable to delete file: \tmp\titanium-test\data\system\schema_keyspaces\system-schema_keyspaces-ib-2-Index.db  org.apache.commons.io.FileUtils.forceDelete (FileUtils.java:1643)

these files/folders are in use (the rest I could delete manually):

s:\tmp\titanium-test
s:\tmp\titanium-test\commitlog
s:\tmp\titanium-test\data
s:\tmp\titanium-test\commitlog\CommitLog-2-1367251736036.log
s:\tmp\titanium-test\commitlog\CommitLog-2-1367251736037.log
s:\tmp\titanium-test\data\system
s:\tmp\titanium-test\data\system\local
s:\tmp\titanium-test\data\system\schema_columnfamilies
s:\tmp\titanium-test\data\system\schema_columns
s:\tmp\titanium-test\data\system\schema_keyspaces
s:\tmp\titanium-test\data\system\local\system-local-ib-1-Data.db
s:\tmp\titanium-test\data\system\local\system-local-ib-1-Index.db
s:\tmp\titanium-test\data\system\local\system-local-ib-2-Data.db
s:\tmp\titanium-test\data\system\local\system-local-ib-2-Index.db
s:\tmp\titanium-test\data\system\local\system-local-ib-3-Data.db
s:\tmp\titanium-test\data\system\local\system-local-ib-3-Index.db
s:\tmp\titanium-test\data\system\schema_columnfamilies\system-schema_columnfamilies-ib-10-Index.db
s:\tmp\titanium-test\data\system\schema_columnfamilies\system-schema_columnfamilies-ib-11-Index.db
s:\tmp\titanium-test\data\system\schema_columnfamilies\system-schema_columnfamilies-ib-9-Index.db
s:\tmp\titanium-test\data\system\schema_columns\system-schema_columns-ib-1-Index.db
s:\tmp\titanium-test\data\system\schema_columns\system-schema_columns-ib-2-Data.db
s:\tmp\titanium-test\data\system\schema_columns\system-schema_columns-ib-2-Index.db
s:\tmp\titanium-test\data\system\schema_keyspaces\system-schema_keyspaces-ib-1-Index.db
s:\tmp\titanium-test\data\system\schema_keyspaces\system-schema_keyspaces-ib-2-Index.db
zmaril commented 11 years ago

I just tried the above out on my machine (MBP OS X) and there were no errors. This is most likely a windows issue for some reason. Can you launch the REPL outside of your IDE, repeat the above, and see if that has any effect?

michaelklishin commented 11 years ago

They are Cassandra files. We should probably rethink the way we reset the graph (if we can).

zmaril commented 11 years ago

Titan currently doesn't support removing types which is why we do this clear-db trickery. It's not a great solution, but it's the best one I've come up with so far. If anybody has other ways of doing this, I'm all ears.

ghost commented 11 years ago

I'm trying in a lein repl but it's extremely painful :)) oh looks like I got the ns dash wrong

the same thing happens though

clojurewerks.titanium.edges_test=> (in-ns 'clojurewerkz.titanium.edges_test)
#<Namespace clojurewerkz.titanium.edges_test>
clojurewerkz.titanium.edges_test=> (clojure.core/use 'clojurewerkz.titanium.edges_test)
nil
clojurewerkz.titanium.edges_test=> (clear-db)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: clear-db in this context, compiling:(NO_SOURCE_PATH:1:1)

clojurewerkz.titanium.edges_test=> (clojurewerkz.titanium.conf/clear-db)
nil
clojurewerkz.titanium.edges_test=> (tg/open conf)
CompilerException java.lang.RuntimeException: No such namespace: tg, compiling:(NO_SOURCE_PATH:1:1)

clojurewerkz.titanium.edges_test=> (in-ns 'clojurewerkz.titanium.edges-test)
#<Namespace clojurewerkz.titanium.edges-test>
clojurewerkz.titanium.edges-test=> (tg/open conf)
MemoryMeter uninitialized (jamm not specified as java agent); KeyCache size in JVM Heap will not be calculated accurately. Usually this mean
s cassandra-env.sh disabled jamm because you are using a buggy JRE; upgrade to the Sun JRE instead
No host ID found, created 11a16e96-7ac3-4771-9fa5-a0c099f79625 (Note: This should happen exactly once per node).
Generated random token [4682540671321467433]. Random tokens will result in an unbalanced ring; see http://wiki.apache.org/cassandra/Operatio
ns
#<StandardTitanGraph titangraph[embeddedcassandra:null]>
clojurewerkz.titanium.edges-test=> (tg/shutdown)
nil
clojurewerkz.titanium.edges-test=> (tg/shutdown)
nil
clojurewerkz.titanium.edges-test=> (clear-db)
IOException Unable to delete file: \tmp\titanium-test\data\system\schema_keyspaces\system-schema_keyspaces-ib-2-Index.db  org.apache.commons
.io.FileUtils.forceDelete (FileUtils.java:1643)

clojurewerkz.titanium.edges-test=>
ghost commented 11 years ago

is it possible that a TitanException is thrown here: https://github.com/thinkaurelius/titan/blob/master/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/database/StandardTitanGraph.java#L87 but we're not seeing it for some reason? ie. it gets eaten on shutdown looking at this: https://github.com/clojurewerkz/archimedes/blob/master/src/archimedes/core.clj#L44 it doesn't seem to be the case, I mean, if that would throw we'd see it.

Either way, I'm guessing the problem is in titan, I'll keep looking

EDIT: on first look https://github.com/thinkaurelius/titan/blob/master/titan-cassandra/src/main/java/com/thinkaurelius/titan/diskstorage/cassandra/embedded/CassandraEmbeddedStoreManager.java#L119 the .close there doesn't seem to be doing any closing, just clearing a hash

zmaril commented 11 years ago

Perhaps try doing the same thing in Titan via the gremlin shell. Open up a db with the yaml file Titanium uses for testing, close the db, and then remove \tmp\titanium-test. That should tell you if it is a Titan bug or not.

I'm mostly convinced this is a windows permissions issue of some sort, but I don't know enough about windows to help you debug more effectively. If other people start reporting the same problem for windows or in a few weeks, whichever comes first, I'll take a few hours and a windows instance on EC2 and try to see if i can't figure out what's going on.

michaelklishin commented 10 years ago

Closing as too old and seemingly env-specific.