Announcement Announcement Module
No announcement yet.
Tests randomly fail for simple projects that use MYSQL db but work in HYPERSONIC_IN_M Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tests randomly fail for simple projects that use MYSQL db but work in HYPERSONIC_IN_M

    I was noticing that my tests would fail, with "java.lang.AssertionError: Data on demand for 'Thing' failed to initialize correctly" (replace 'Thing' with the name of a random class). My search through the forums found a similar, though not same issue where the reporter said that the tests would eventually pass if you re-ran them often enough. So I started re-running my tests, and noticed that the failing classes would change with each run.

    In order to rule out something I may have changed during round-trip engineering, I created a new basic project (attached as log.roo-InMemoryTest.txt). To my disappointment, it worked fine. After further attempts with my main project such as re-creating all the integration tests, I decided to go back to my test project and try using the MYSQL database that I was using for my main project (attached as log.roo-MySqlTest.txt)... and Voila! My simple little four entity project will fail on random classes and then every now and then pass. (see attached TestResults.txt)

    In fairness, this might be a bit complex of an example, since the "Thing" entity has a reference to a "Store" and a "Person", and the "Storage" entity has a collection of "Thing"s. However, that's not really that complex of a scenario in real life. Given that the error message in the surefire-report references "failed to initialize correctly", I suspect that the failure may be due to an order of executing the tests... but that's just a guess.

    I will try installing 1.1.0.M2 to see if the situation persists.

    Thanks for all your hard work on this project, the above incident aside, I love this tool.

    A JIRA Issue has been created: ROO-1127.
    Last edited by wrochow; Jul 21st, 2010, 10:59 AM.