slagyr / speclj

pronounced "speckle": a TDD/BDD framework for Clojure.
MIT License
459 stars 58 forks source link

lein spec -a fails to find namespace on reload #127

Open loganmhb opened 9 years ago

loganmhb commented 9 years ago

When running autotests with lein spec -a, speclj sometimes throws the following error:

java.lang.Exception: namespace 'myproject.handler' not found after loading '/myproject/handler', compiling

which appears to be a possible regression of issue #33. (I am using Speclj 3.2.0.) This happens predictably for certain files, only on autotest and only after reloading the file at least once.

Full trace: ... 12 stack levels elided ... at myproject.handler_spec$eval3478$loading4958auto__3479.invoke(handler_spec.clj:1) at myproject.handler_spec$eval3478.invoke(handler_spec.clj:1) ... 21 stack levels elided ... at fresh.core$load_nses.invoke(core.clj:166) at fresh.core$doto_nses.doInvoke(core.clj:173) ... 1 stack levels elided ... at fresh.core$make_fresh.invoke(core.clj:191) ... 7 stack levels elided ... at fresh.core$make_fresh.invoke(core.clj:188) ... 17 stack levels elided ... Caused by: java.lang.Exception: namespace 'myproject.handler' not found after loading '/myproject/handler' ... 10 stack levels elided ... at myproject.handler_spec$eval3478$loading4958auto__3479.invoke(handler_spec.clj:1) at myproject.handler_spec$eval3478.invoke(handler_spec.clj:1) ... 21 stack levels elided ... at fresh.core$load_nses.invoke(core.clj:166) at fresh.core$doto_nses.doInvoke(core.clj:173) ... 1 stack levels elided ... at fresh.core$make_fresh.invoke(core.clj:191) ... 7 stack levels elided ... at fresh.core$make_fresh.invoke(core.clj:188) ... 17 stack levels elided ...

trptcolin commented 9 years ago

Do you have an example project up somewhere shareable? I'm wondering if it could be something off about the ns form - I've seen this issue if I've moved a file and its ns form doesn't match the filename anymore, or if the file has errors, things like that.

eigenhombre commented 9 years ago

@trptcolin Not yet -- it's in a private repo, and we haven't made a minimal failing case yet. The namespaces and filenames are straightforward -- and the error is intermittent, as well, until it occurs once, in which case it happens after each file save.

thesoftwarephilosopher commented 9 years ago

Sounds like the same problem I was having in #109. And ours also is a private repo, so we can't share it.