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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: