Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-22259

Make XWiki TC-based tests work with MySQL 8.4 (LTS)

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A

    Description

      Error:

      13:27:29.707 [docker-java-stream-159362837] INFO  o.x.t.d.i.j.d.DatabaseContainerExecutor - STDERR: 2024-06-13T11:27:29.703106Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.
      13:27:29.759 [main] DEBUG o.t.s.c.g.d.c.command.AbstrDockerCmd - Cmd: 535566248b25d6ad99d74e7abd89ee924fa636513b21ca35b3f2f2571de52996,false
      13:27:29.761 [main] DEBUG o.t.s.c.g.d.c.e.InspectContainerCmdExec - GET: DefaultWebTarget{path=[/containers/535566248b25d6ad99d74e7abd89ee924fa636513b21ca35b3f2f2571de52996/json], queryParams={}}
      13:27:29.903 [main] DEBUG tc.mysql:8.4 - Failure when trying test query
      java.sql.SQLException: Could not create new connection
              at org.testcontainers.containers.JdbcDatabaseContainer.createConnection(JdbcDatabaseContainer.java:263)
              at org.testcontainers.containers.JdbcDatabaseContainer.createConnection(JdbcDatabaseContainer.java:219)
              at org.testcontainers.containers.JdbcDatabaseContainer.waitUntilContainerStarted(JdbcDatabaseContainer.java:159)
              at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:500)
              at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:354)
              at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
              at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:344)
              at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:330)
              at org.xwiki.test.docker.internal.junit5.DockerTestUtils.startContainerInternal(DockerTestUtils.java:218)
              at org.xwiki.test.docker.internal.junit5.DockerTestUtils.startContainer(DockerTestUtils.java:181)
              at org.xwiki.test.docker.internal.junit5.AbstractContainerExecutor.start(AbstractContainerExecutor.java:56)
              at org.xwiki.test.docker.internal.junit5.database.DatabaseContainerExecutor.startDatabaseContainer(DatabaseContainerExecutor.java:297)
              at org.xwiki.test.docker.internal.junit5.database.DatabaseContainerExecutor.startMySQLContainer(DatabaseContainerExecutor.java:145)
              at org.xwiki.test.docker.internal.junit5.database.DatabaseContainerExecutor.startMySQLContainer(DatabaseContainerExecutor.java:115)
              at org.xwiki.test.docker.internal.junit5.database.DatabaseContainerExecutor.start(DatabaseContainerExecutor.java:71)
              at org.xwiki.test.docker.internal.junit5.XWikiDockerExtension.startDatabase(XWikiDockerExtension.java:434)
              at org.xwiki.test.docker.internal.junit5.XWikiDockerExtension.beforeAllInternal(XWikiDockerExtension.java:167)
              at org.xwiki.test.docker.internal.junit5.XWikiDockerExtension.beforeAll(XWikiDockerExtension.java:109)
              at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$12(ClassBasedTestDescriptor.java:396)
              at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
              at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:396)
              at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:212)
              at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:85)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:148)
              at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
              at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
              at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
              at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
              at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
              at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
              at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
              at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
              at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
              at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
              at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
              at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:198)
              at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:169)
              at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:93)
              at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:58)
              at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:141)
              at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:57)
              at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103)
              at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85)
              at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47)
              at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:56)
              at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184)
              at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148)
              at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122)
              at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
              at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
              at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
              at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
      Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
      
      The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
              at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:165)
              at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:55)
              at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:861)
              at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:449)
              at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:234)
              at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:180)
              at org.testcontainers.containers.JdbcDatabaseContainer.createConnection(JdbcDatabaseContainer.java:254)
              ... 60 common frames omitted
      Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
      
      The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
              at jdk.internal.reflect.GeneratedConstructorAccessor27.newInstance(Unknown Source)
              at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
              at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
              at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:52)
              at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:95)
              at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:140)
              at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:156)
              at com.mysql.cj.protocol.a.NativeProtocol.readMessage(NativeProtocol.java:597)
              at com.mysql.cj.protocol.a.NativeProtocol.readServerCapabilities(NativeProtocol.java:521)
              at com.mysql.cj.protocol.a.NativeProtocol.beforeHandshake(NativeProtocol.java:412)
              at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1338)
              at com.mysql.cj.NativeSession.connect(NativeSession.java:152)
              at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:980)
              at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:851)
              ... 64 common frames omitted
      Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
              at com.mysql.cj.protocol.FullReadInputStream.readFully(FullReadInputStream.java:58)
              at com.mysql.cj.protocol.a.SimplePacketReader.readHeaderLocal(SimplePacketReader.java:72)
              at com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:54)
              at com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:36)
              at com.mysql.cj.protocol.a.NativeProtocol.readMessage(NativeProtocol.java:591)
              ... 70 common frames omitted
      13:27:30.019 [main] DEBUG o.t.s.c.g.d.c.command.AbstrDockerCmd - Cmd: 535566248b25d6ad99d74e7abd89ee924fa636513b21ca35b3f2f2571de52996,false
      13:27:30.020 [main] DEBUG o.t.s.c.g.d.c.e.InspectContainerCmdExec - GET: DefaultWebTarget{path=[/containers/535566248b25d6ad99d74e7abd89ee924fa636513b21ca35b3f2f2571de52996/json], queryParams={}}
      

      It works fine with 8.3.

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: