Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-1127

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



    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 1.1.0.M1
    • Fix Version/s: 1.1.0.M3
    • Component/s: PERSISTENCE, TESTING
    • Labels:
    • Environment:
      Linux (Ubuntu 10.04), MySQL (MySQL 5.1.41-3ubuntu12.3) on localhost ROO 1.1.0.M1


      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.


          Issue Links



              stewarta Alan Stewart
              wrochow Waldo Rochow
              1 Vote for this issue
              4 Start watching this issue