EasyMock
  1. EasyMock
  2. EASYMOCK-21

finalize() should be treated specially

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 3.1
    • Component/s: Class Extension
    • Labels:
      None

      Description

      If I lose all references to a mock in a test, it may (or may not) get GCed before the test is over. If it does happen, this creates an expectation of a call to finalize(), making the test fail. Since the GC is unpredictable, this leads to flaky tests.
      We should treat finalize() specially, probably by ignoring it completely, since it makes no sense to expect it given that there's no way to force GC.

        Activity

        Hide
        Henri Tremblay added a comment - - edited

        finalize calls are now ignored

        Show
        Henri Tremblay added a comment - - edited finalize calls are now ignored
        Hide
        Sean Flanigan added a comment -

        That should be "finalize calls are now ignored", right? It looks that way from the SVN commit. http://easymock.svn.sourceforge.net/viewvc/easymock?view=revision&revision=223

        Thanks for the fix.

        Show
        Sean Flanigan added a comment - That should be "finalize calls are now ignored", right? It looks that way from the SVN commit. http://easymock.svn.sourceforge.net/viewvc/easymock?view=revision&revision=223 Thanks for the fix.
        Hide
        Henri Tremblay added a comment - - edited

        Absolutely. Fixed

        Show
        Henri Tremblay added a comment - - edited Absolutely. Fixed

          People

          • Assignee:
            Henri Tremblay
            Reporter:
            Henri Tremblay
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: