bensu / doo

doo is a library and lein plugin to run cljs.test on different js environments.
Eclipse Public License 1.0
324 stars 63 forks source link

'auto' mode with Karma: suite runs again before completion, on file changes #155

Open vemv opened 6 years ago

vemv commented 6 years ago

Hi!

I found out that when running e.g. lein doo chrome-headless dev (this is, 'auto' mode), when one touches a file, the test suite will be run again even though the current one may not have finished.

For example, for this never-ending test:

(deftest sample
  (testing "A test that never completes"
    (async done)))

When I leave the test suite running 'forever' (which won't fail given my :doo {:paths {:karma "karma --browserNoActivityTimeout 600000"}} setting), with each file save the suite will be triggered again.

The correct behavior would be to wait till completion, rather than have concurrently-running suites (that's what I think that can happen at times).

I created a repro repo, fortunately with just 1 isolated relevant commit: https://github.com/vemv/doo-repro/commit/94d37efbe4585e612256ef09d699d085ade7a350

Dunno if I'm the first to notice this. I reckon that without browserNoActivityTimeout the issue is harder to notice. I need that setting for performing Selenium-like tests.

Cheers - Victor

vemv commented 6 years ago

Btw when I close a long auto testing session I can read this:

Close Karma run
Close Karma run
Close Karma run
Close Karma run
Close Karma run
Close Karma run
Close Karma run
Close Karma run
Close Karma run
Close Karma run
Close Karma run
Shutdown Karma Server
Close Karma run
Close Karma run
Close Karma run
metametadata commented 6 years ago

I see the same problem: there're numerous Karma "run"s created and their log outputs interleave.

Also often the whole "lein doo" process fails after several runs, maybe it can be related.