Grails
  1. Grails
  2. GRAILS-8176

DomainClassUnitTestMixin causes integration test failure

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0-M2, 2.0-RC1
    • Fix Version/s: 2.0-RC1
    • Component/s: Testing
    • Labels:
    • Environment:
      Tested against 2.0-M2 and snapshot build #1501.
    • Testcase included:
      yes

      Description

      We have been running into problems with the new test framework. In some (strange) scenarios seemingly unrelated tests can cause other tests to fail, even across phase boundaries. In this case, the presence of a unit test utilizing DomainClassUnitTestMixin causes an integration test to fail. Switching to @Mock or removing any one of 2 test cases causes the integration test to pass.

      This is a really frustrating problem to encounter because it is not always obvious (to me at least) how to tweak the tests to workaround the issue.

        Activity

        Hide
        Graeme Rocher added a comment -

        Seems to work fine in git master

        Show
        Graeme Rocher added a comment - Seems to work fine in git master
        Hide
        Jay Hogan added a comment -

        One of my colleagues tested against Git master and was able to reproduce. This seems unlikely to be an environmental issue, but we are running Windows (XP 32bit and 7) and Java 1.6.0_25 and 1.6.0_26. My colleague is spinning up linux VM right now to see he can reproduce the issue.

        Show
        Jay Hogan added a comment - One of my colleagues tested against Git master and was able to reproduce. This seems unlikely to be an environmental issue, but we are running Windows (XP 32bit and 7) and Java 1.6.0_25 and 1.6.0_26. My colleague is spinning up linux VM right now to see he can reproduce the issue.
        Hide
        Jay Hogan added a comment -

        Now that I have narrowed down the issue, I was able to replace all instances of @TestMixin(DomainClassUnitTestMixin) + mockDomain() with @Mock(....) and all the tests is happy again.

        Show
        Jay Hogan added a comment - Now that I have narrowed down the issue, I was able to replace all instances of @TestMixin(DomainClassUnitTestMixin) + mockDomain() with @Mock(....) and all the tests is happy again.
        Hide
        Jay Hogan added a comment -

        Confirmed that this issue cannot be reproduced on linux. If you could not reproduce under Linux or Mac, please re-open the ticket and test on Windows. Thanks!

        Show
        Jay Hogan added a comment - Confirmed that this issue cannot be reproduced on linux. If you could not reproduce under Linux or Mac, please re-open the ticket and test on Windows. Thanks!

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Jay Hogan
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development