lambdaisland / kaocha

Full featured next gen Clojure test runner
https://cljdoc.org/d/lambdaisland/kaocha/
Eclipse Public License 1.0
803 stars 84 forks source link

Issue with running with --watch #412

Closed JagGunawardana closed 1 year ago

JagGunawardana commented 1 year ago

When I run with --watch all works fine on first run, then I get issues with reloading code on changes. If I kill kkaocha and restart the 'watched' test runner, then it starts working again.

Using this tests.edn (ignore line nos):

#kaocha/v1
 {:tests           [{:id          :unit
                     :test-paths  ["test" "src"]
                     :ns-patterns [".*"]}]
  :watch?          false
  :color?          true
  ;:reporter        kaocha.report.progress/report
  :capture-output? true
   :fail-fast?      false
   :plugins         [:kaocha.plugin/profiling
                     :kaocha.plugin/print-invocations
                     :kaocha.plugin/notifier]
  }

Error is

[watch] Re-running failed tests #{:unit}
[E]WARNING: Notification not shown because system is headless.
Consider disabling the notifier plugin when using in this context.

Randomized with --seed 503467189

ERROR in unit (load.clj:48)
Failed loading tests:
Exception: java.lang.NullPointerException: null
 at java.util.concurrent.ConcurrentHashMap.get (ConcurrentHashMap.java:936)
    ...
    kaocha.type.ns$eval4707$fn__4708.invoke (ns.clj:38)
    ...
    kaocha.testable$load.invokeStatic (testable.clj:94)
    kaocha.testable$load.invoke (testable.clj:75)
    kaocha.testable$load_testables.invokeStatic (testable.clj:153)
    kaocha.testable$load_testables.invoke (testable.clj:145)
    kaocha.load$load_test_namespaces.invokeStatic (load.clj:48)
    kaocha.load$load_test_namespaces.doInvoke (load.clj:36)
    ...
    kaocha.type.clojure.test$eval4759$fn__4760.invoke (test.clj:16)
    ...
    kaocha.testable$load.invokeStatic (testable.clj:94)
    kaocha.testable$load.invoke (testable.clj:75)
    kaocha.testable$load_testables.invokeStatic (testable.clj:153)
    kaocha.testable$load_testables.invoke (testable.clj:145)
    kaocha.api$test_plan.invokeStatic (api.clj:58)
    kaocha.api$test_plan.invoke (api.clj:51)
    kaocha.api$run$fn__3244.invoke (api.clj:103)
    ...
    kaocha.api$run.invokeStatic (api.clj:101)
    kaocha.api$run.invoke (api.clj:88)
    kaocha.watch$try_run$fn__4536.invoke (watch.clj:55)
    kaocha.watch$try_run.invokeStatic (watch.clj:54)
    kaocha.watch$try_run.invoke (watch.clj:46)
    kaocha.watch$run_loop.invokeStatic (watch.clj:207)
    kaocha.watch$run_loop.invoke (watch.clj:201)
    kaocha.watch$run_STAR_.invokeStatic (watch.clj:347)
    kaocha.watch$run_STAR_.invoke (watch.clj:302)
    kaocha.watch$run$fn__4652.invoke (watch.clj:357)
    ...
    kaocha.watch$run$fn__4654.invoke (watch.clj:364)
    ...
    java.util.concurrent.FutureTask.run (FutureTask.java:264)
    java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    ...
1 tests, 1 assertions, 1 errors, 0 failures.
alysbrooks commented 1 year ago

Thanks for the bug report! What version of Kaocha are you using? Also, is this an issue with all namespaces or just certain ones?

humorless commented 1 year ago

Hello @JagGunawardana ,

Can you consider to provide a repo for me to reproduce your bug? I have used the tests.edn you provided to try to reproduce but it just works smoothly on my machine.

oxalorg commented 1 year ago

Hey @JagGunawardana if you're still facing this issue and are willing to provide more information / reproducibile setup feel free to re-open this issue. For the time being I'm marking this as closed.