Failing test in test_pretty.clj

2 views
Skip to first unread message

Rasmus Svensson

unread,
Aug 7, 2010, 4:32:22 PM8/7/10
to cloju...@googlegroups.com
I don't know whether this is already known, but I get this when running "ant test" on both the master and 1.2.x branches (commits ac484ba40cc1d94d42ce... and 0f47e7c575390ddf0df8...):

     [java] FAIL in (pprint-datastructures-tests) (test_pretty.clj:226)
     [java] expected: ((var clojure.test-clojure.pprint.test-helper/back-match) (tst-pprint 20 (failed-agent)) #"#<Agent@[0-9a-f]+ FAILED: \n  \"foo\">")
     [java]   actual: nil

I've searched the dev list and I didn't find anything about this. I very recently became a contributor, so please correct me if I am missing something.

regards,
Rasmus

Tom Faulhaber

unread,
Aug 7, 2010, 8:42:49 PM8/7/10
to cloju...@googlegroups.com
Odd. ant test works fine on a clean checkout on both those commits here. Maybe try ant clean; ant; ant test and see what happens.

Tom

--
You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
To post to this group, send email to cloju...@googlegroups.com.
To unsubscribe from this group, send email to clojure-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/clojure-dev?hl=en.

Rasmus Svensson

unread,
Aug 8, 2010, 12:50:37 AM8/8/10
to cloju...@googlegroups.com
2010/8/8 Tom Faulhaber <tomfau...@gmail.com>:

> Odd. ant test works fine on a clean checkout on both those commits here.
> Maybe try ant clean; ant; ant test and see what happens.
>
> Tom
>

I started with a fresh clone, as I did last time. This time I tried to
run ant clean too.

git clone http://github.com/clojure/clojure.git
cd clojure
ant clean
ant

Everything okay so far...

ant test

In the output of at test I get:

test:
[java] Loading tests...
*snip*


[java] FAIL in (pprint-datastructures-tests) (test_pretty.clj:226)
[java] expected: ((var
clojure.test-clojure.pprint.test-helper/back-match) (tst-pprint 20
(failed-agent)) #"#<Agent@[0-9a-f]+ FAILED: \n \"foo\">")
[java] actual: nil

*snip*
[java] Ran 361 tests containing 4325 assertions.
[java] 1 failures, 0 errors.

The strange thing is that this test doesn't fail every time I run it.

I have tried to compile both the master and 1.2.x branch on both my
server and my laptop -- Ubuntu Karmic Koala with sun-java6-jdk version
1.6.0_20 on both.

I don't know what details are relevant other than these, so feel free
to ask if you would need some additional info.

// raek

Stacktrace:

BUILD FAILED
java.lang.Exception: 1 failures, 0 errors. (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:5435)
at clojure.lang.Compiler.eval(Compiler.java:5386)
at clojure.core$eval.invoke(core.clj:2382)
at clojure.main$eval_opt.invoke(main.clj:235)
at clojure.main$initialize.invoke(main.clj:254)
at clojure.main$null_opt.invoke(main.clj:279)
at clojure.main$main.doInvoke(main.clj:354)
at clojure.lang.RestFn.invoke(RestFn.java:422)
at clojure.lang.Var.invoke(Var.java:369)
at clojure.lang.AFn.applyToHelper(AFn.java:165)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
at org.apache.tools.ant.taskdefs.Java.run(Java.java:764)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:218)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:132)
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.Exception: 1 failures, 0 errors.
at clojure.test_clojure$run_ant$report__13.invoke(test_clojure.clj:91)
at clojure.test$do_report.invoke(test.clj:344)
at clojure.test$run_tests.doInvoke(test.clj:740)
at clojure.lang.RestFn.applyTo(RestFn.java:138)
at clojure.core$apply.invoke(core.clj:540)
at clojure.test_clojure$run.invoke(test_clojure.clj:77)
at clojure.test_clojure$run_ant.invoke(test_clojure.clj:93)
at user$eval18.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:5419)
... 37 more

Stuart Halloway

unread,
Aug 8, 2010, 10:01:39 AM8/8/10
to cloju...@googlegroups.com
Rasmus, what happens if you bump the timeout on await-for inside failed-agent?

Stu

Rasmus Svensson

unread,
Aug 8, 2010, 10:40:57 AM8/8/10
to cloju...@googlegroups.com
2010/8/8 Stuart Halloway <stuart....@gmail.com>:

> Rasmus, what happens if you bump the timeout on await-for inside failed-agent?
>
> Stu

Changed the timeout from 100 to 10000. Now the tests passes most of
the time (but not every) on my laptop, but for my other computer
(which is atom based and a bit slower), it still fails almost every
time.

// raek

Aaron Bedra

unread,
Aug 8, 2010, 10:54:49 AM8/8/10
to cloju...@googlegroups.com
I actually noticed the same behavior on windows as well.

Aaron

Aaron Bedra

unread,
Aug 8, 2010, 10:57:19 AM8/8/10
to cloju...@googlegroups.com
I had the failures on my quad core 12GB of ram desktop.

Aaron

Tom Faulhaber

unread,
Aug 9, 2010, 3:15:04 PM8/9/10
to Clojure Dev
Rasmus, et al.,

I see what the problem is (a bug in my code that was supposed to
prevent races) and I've created bug 421 with a patch to correct it:

http://www.assembla.com/spaces/clojure/tickets/421-clojure-tests-can-fail-because-of-a-race-in-the-pprint-tests

Rasmus, could you apply the patch there and let me know if it solves
your problem?

Thanks (and sorry for the bug),

Tom

Rasmus Svensson

unread,
Aug 14, 2010, 4:07:38 PM8/14/10
to cloju...@googlegroups.com
2010/8/14 Tom Faulhaber <tomfau...@gmail.com>:
> Rasmus,
>
> Did you see this message? Have you had a chance to confirm that my patch
> works.
>
> I'd like to push this into 1.2 as a last minute tweak to the tests so folks'
> tests are reliable.
>
> Tom

I'm sorry for delay...

Yes, after applying that patch, the tests pass every time for me.

// raek

Reply all
Reply to author
Forward
0 new messages