Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-6143

PowerMock should not be used in Geode tests [PERMANENT]

    XMLWordPrintableJSON

Details

    Description

      At least one usage of PowerMock in our unit tests is leaking and causing other tests to fail with the following stack.

      No further tests should be written using PowerMock and all tests that currently use it need to be identified and changed (along with product code refactoring) to not use PowerMock.

      We will then remove PowerMock as a dependency from Geode.

      2018-12-04 18:11:36,258 Distributed system shutdown hook ERROR Could not reconfigure JMX java.lang.LinkageError: loader constraint violation: loader (instance of org/powermock/core/classloader/MockClassLoader) previously initiated loading for a different type with name "javax/management/MBeanServer"
      	at java.lang.ClassLoader.defineClass1(Native Method)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
      	at org.powermock.core.classloader.MockClassLoader.loadUnmockedClass(MockClassLoader.java:262)
      	at org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:206)
      	at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass1(DeferSupportingClassLoader.java:89)
      	at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:79)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	at org.apache.logging.log4j.core.jmx.Server.unregisterAllMatching(Server.java:337)
      	at org.apache.logging.log4j.core.jmx.Server.unregisterLoggerContext(Server.java:261)
      	at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:165)
      	at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:141)
      	at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:558)
      	at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:619)
      	at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:636)
      	at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:231)
      	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:243)
      	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
      	at org.apache.logging.log4j.LogManager.getContext(LogManager.java:174)
      	at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:661)
      	at org.apache.geode.internal.logging.LogService.getLogger(LogService.java:64)
      	at org.apache.geode.internal.tcp.ConnectionTable.<clinit>(ConnectionTable.java:61)
      	at org.apache.geode.distributed.DistributedSystem.setThreadsSocketPolicy(DistributedSystem.java:263)
      	at org.apache.geode.distributed.internal.InternalDistributedSystem.lambda$static$0(InternalDistributedSystem.java:2317)
      	at java.lang.Thread.run(Thread.java:748)
      

      Attachments

        Activity

          People

            klund Kirk Lund
            klund Kirk Lund
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 13h 10m
                13h 10m