Uploaded image for project: 'Jalview'
  1. Jalview
  2. JAL-4695

jalview.bin.MemorySettingTest fails when run from gradlew but passes in Eclipse

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Being documented
    • Priority: Blocker
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 2.12.0.0
    • Component/s: gradle, Test suite
    • Labels:
      None

      Description

      Default eclipse config with the refactored build tree seems to execute tests directly via the workspace configured jvm (ie 17, 21, or 25), and all pass.

      When gradlew runs on the command line it downloads an 11 jvm - which it uses to execute tests. This configuration doesn't let jalview.bin.MemorySettingTest pass. Annoyingly ./gradlew jalview-app:test doesn't provide an option to report stdout/stderr so no obvious issues are revealed.

      Manually configuring eclipse to run the testng tests using the same jvm reveals stdout/stderr like:

      [RemoteTestNG] detected TestNG version 7.12.0
      SLF4J(W): Class path contains multiple SLF4J providers.
      SLF4J(W): Found provider [org.apache.logging.slf4j.SLF4JServiceProvider@3444d69d]
      SLF4J(W): Found provider [org.slf4j.nop.NOPServiceProvider@1372ed45]
      SLF4J(W): See https://www.slf4j.org/codes.html#multiple_bindings for an explanation.
      SLF4J(I): Actual provider is of type [org.apache.logging.slf4j.SLF4JServiceProvider@3444d69d]
      java.lang.IllegalAccessException: class jalview.bin.GetMemory cannot access class com.sun.management.internal.OperatingSystemImpl (in module jdk.management) because module jdk.management does not export com.sun.management.internal to unnamed module @20312893
      Cannot obtain total memory size of this device
      Not enough physical memory for application. Ignoring MemorySetting Property 'jvmmempc' (100). Using maximum memory available (-1).
      Capping maximum memory to 8g due to failure to read physical memory size.
      java.lang.IllegalAccessException: class jalview.bin.GetMemory cannot access class com.sun.management.internal.OperatingSystemImpl (in module jdk.management) because module jdk.management does not export com.sun.management.internal to unnamed module @20312893
      Cannot obtain total memory size of this device
      Not enough physical memory for application. Ignoring MemorySetting Property 'jvmmempc' (100). Using maximum memory available (-1).
      Capping maximum memory to 8g due to failure to read physical memory size.
      java.lang.IllegalAccessException: class jalview.bin.GetMemory cannot access class com.sun.management.internal.OperatingSystemImpl (in module jdk.management) because module jdk.management does not export com.sun.management.internal to unnamed module @20312893
      Cannot obtain total memory size of this device
      Not enough physical memory for application. Ignoring MemorySetting Property 'jvmmempc' (10). Using maximum memory available (-1).
      Capping maximum memory to 8g due to failure to read physical memory size.
      FAILED: jalview.bin.MemorySettingTest.testGetMemorySetting
      java.lang.AssertionError:
      at org.testng.AssertJUnit.fail(AssertJUnit.java:65)
      at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:23)
      at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:33)
      at jalview.bin.MemorySettingTest.testGetMemorySetting(MemorySettingTest.java:65)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:141)
      at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:697)
      at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:230)
      at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:63)
      at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:1005)
      at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:203)
      at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:154)
      at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:134)
      at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
      at org.testng.TestRunner.privateRun(TestRunner.java:744)
      at org.testng.TestRunner.run(TestRunner.java:616)
      at org.testng.SuiteRunner.runTest(SuiteRunner.java:421)
      at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:413)
      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:373)
      at org.testng.SuiteRunner.run(SuiteRunner.java:312)
      at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95)
      at org.testng.TestNG.runSuitesSequentially(TestNG.java:1274)
      at org.testng.TestNG.runSuitesLocally(TestNG.java:1208)
      at org.testng.TestNG.runSuites(TestNG.java:1112)
      at org.testng.TestNG.run(TestNG.java:1079)
      at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
      at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:293)
      at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:91)


      ===============================================
          Default test
          Tests run: 1, Failures: 1, Skips: 0
      ===============================================


      ===============================================
      Default suite
      Total tests run: 1, Passes: 0, Failures: 1, Skips: 0
      ===============================================

        Attachments

          Activity

            People

            Assignee:
            jprocter James Procter
            Reporter:
            jprocter James Procter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: