On Sat, Apr 17, 2010 at 15:45, B Smith-Mannschott <bsmith.o...@gmail.com> wrote:
> More oddness:
>
> If I remove all unit tests *except* test-compex-numbers, all is well:
>
>  [INFO] [clojure:test {execution: test-clojure}]
>
>  Testing clojure.contrib.test-complex-numbers
>
>  Ran 8 tests containing 268 assertions.
>  0 failures, 0 errors.

Actually, that's not true. The unit tests *usually* run
without error, but sometimes crash with a NPE in LazySeq.sval.

Here's a script I'm using:

[[file: .git/this-build-fails]]
#!/bin/bash
log=".git/$(date +%F%H%M%S)-$(git log --oneline|head -n 1|cut -d' ' -f1).log"
(
  mvn clean
  mvn test
) > $log 2>&1
if grep -q ERROR < $log
then
        echo "build had ERROR: $log"
        exit 0
else
        echo "build was OK"
        rm "$log"
        exit 1
fi

Here's what I told my shell to do, and the resulting output

smit...@pepper:~/w/clojure-contrib$ while true ; do .git/this-build-fails ; done
build was OK
build had ERROR: .git/2010-04-17172643-2bc0dcc.log
build had ERROR: .git/2010-04-17172745-2bc0dcc.log
build was OK
build was OK
build was OK
build was OK
build had ERROR: .git/2010-04-17173302-2bc0dcc.log
build was OK
build had ERROR: .git/2010-04-17173510-2bc0dcc.log
build was OK
build was OK
build was OK
build was OK
build had ERROR: .git/2010-04-17174026-2bc0dcc.log
build was OK
build was OK
build was OK
build was OK
build was OK
build was OK
build was OK
build was OK
build was OK

The referenced commit 2bc0dcc is one where I've removed all unit
tests, save for test_complex_numbers.clj

smit...@pepper:~/w/clojure-contrib$ tree src/test/
src/test/
`-- clojure
    `-- clojure
        `-- contrib
            `-- test_complex_numbers.clj

The interesting part of the five log files written above always looks
this same: a NullPointerException in LazySeq.sval

[INFO] [clojure:test {execution: test-clojure}]

Testing clojure.contrib.test-complex-numbers
Exception in thread "main" java.lang.RuntimeException:
java.lang.NullPointerException (run-test1269169458415140791.clj:0)
        at clojure.lang.Compiler.eval(Compiler.java:5389)
        at clojure.lang.Compiler.load(Compiler.java:5784)
        at clojure.lang.Compiler.loadFile(Compiler.java:5747)
        at clojure.main$load_script__6226.invoke(main.clj:213)
        at clojure.main$script_opt__6255.invoke(main.clj:265)
        at clojure.main$main__6273.doInvoke(main.clj:346)
        at clojure.lang.RestFn.invoke(RestFn.java:409)
        at clojure.lang.Var.invoke(Var.java:365)
        at clojure.lang.AFn.applyToHelper(AFn.java:165)
        at clojure.lang.Var.applyTo(Var.java:482)
        at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
        at clojure.lang.LazySeq.sval(LazySeq.java:47)
        at clojure.lang.LazySeq.seq(LazySeq.java:56)
        at clojure.lang.Cons.next(Cons.java:37)

Color me confused.

Also, this isn't giving me warm fuzzy feelings of confidence for my next
Clojure project as I do a lot of my weekend hacking on my netbooks.

// Ben

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to