Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Cake manages faster output when testing #335

Closed
amalloy opened this Issue Nov 22, 2011 · 5 comments

Comments

3 participants
Collaborator

amalloy commented Nov 22, 2011

https://github.com/amalloy/jiraph/tree/lein-tests is a version of Jiraph I was working on that prints loads of output to stdout while testing. When using cake, these tests run in about 22 seconds; with lein it takes 55 seconds. If I remove the debug output, cake runs in 12s and lein in 7s, so cake is taking 10s to print and lein 48s.

I speculate that this is because cake runs the tests in a with-out-str context, then prints the output for each namespace in one go (more or less; I'm pretty sure it's more complicated than that but @lancepantz would be the one to ask). It looks like lein is printing and flushing to stdout as it runs, and so spends a lot of its time blocking.

Owner

technomancy commented Jan 26, 2012

Went to take a look at this, got an exception running lein test in that jiraph branch: Caused by: java.lang.ClassNotFoundException: io.core.InputStream

Binding *flush-on-newline* to false in form-for-testing-namespaces doesn't result in a noticeable speedup here, FWIW.

Collaborator

amalloy commented Jan 26, 2012

The jar for io looks kinda rubbish - it doesn't include either the .java or .class files that it should have. I'm not sure why this happened - theoretically none of the versions we depend on here should have changed (no snapshots), but apparently one of them did. If you switch the dependency on cereal from alpha2 to beta1, you get (transitively) a non-broken version of io and the tests run again.

Collaborator

Raynes commented Jan 26, 2012

@amalloy ninjudd/io@f9a71de I seem to recall something to do with Leiningen's inability to handle nested source paths, which I fixed. It was something strange an irritating anyway.

Owner

technomancy commented Jan 30, 2012

Hmm; I actually get worse timing when wrapping the entire run-tests call in with-out-str by about 8%. Going to push this off to a later release unless someone else wants to investigate.

Owner

technomancy commented Aug 17, 2012

I have a feeling I'm never going to get to this, but if someone wants to reopen to investigate that'd be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment