Weirdness with decompose and concurrency.

33 views
Skip to first unread message

Matt Farmer

unread,
Sep 9, 2012, 4:57:57 PM9/9/12
to lif...@googlegroups.com
Hey folks,

So I was working on developing some simple idiot-light tests for the WePay-Scala module that we open sourced recently, and I was noticing some weird behavior. Specifically that, for no reason I can explain, Extraction.decompose fails to read the case class properly. I've only been able to trigger this behavior while running my unit tests, and it doesn't happen every time - leading me to believe it's some sort of concurrency issue caused by how scalatest executes my tests.

You guys can take a look at the code I'm working on for these tests here: https://github.com/farmdawgnation/wepay-scala/tree/behavioral-development (direct link to the branch I'm working on).


Additionally, you can see the failing test output on Travis CI: http://travis-ci.org/#!/farmdawgnation/wepay-scala/jobs/2388029

Am I doing something obscenely stupid here, is there a bug in the decompose code, or none of the above?

Thanks in advance for taking a look at this.

Cheers,
Matt Farmer

Jeppe Nejsum Madsen

unread,
Sep 10, 2012, 3:24:33 AM9/10/12
to lif...@googlegroups.com
Just took a quick look at the Meta.Memo class and it doesn't look like
the memoize method is thread-safe.

I believe this is a bug, but better have Joni explain if there are
good reasons for this :-)

/Jeppe

Richard Dallaway

unread,
Sep 10, 2012, 4:37:24 AM9/10/12
to lif...@googlegroups.com
By default SBT runs tests in parallel. If you have any state anywhere you have the risk of tests treading on each other.  If that's the problem, you can add this to build.sbt:

parallelExecution in Test := false

Richard

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
 
 

Matt Farmer

unread,
Sep 10, 2012, 9:09:39 AM9/10/12
to lif...@googlegroups.com
Thanks for the tip, that'll solve my immediate problem, but I am still interested to hear what the verdict on memoize is.

--
Matt Farmer
Software Engineer, OpenStudy
http://openstudy.com



Matt Farmer

unread,
Sep 18, 2012, 5:07:03 PM9/18/12
to lif...@googlegroups.com
Hey folks, just curious: has anything happened with this since last week?

--
Matt Farmer
Software Engineer, OpenStudy

Reply all
Reply to author
Forward
0 new messages