mchades opened a new issue, #6506:
URL: https://github.com/apache/gravitino/issues/6506

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   `TestGroupMetaService` run failed, it is an H2 test but found 
`PostgreSQLExceptionConverter` in the stacktrace (see below).
   
   It's because `SQLExceptionConverter` is a static member and other core model 
tests modify it by reflection, like
   
   
https://github.com/apache/gravitino/blob/fb3d900ff0e70514f86dc8462ba07e5611bc4015/core/src/test/java/org/apache/gravitino/storage/TestEntityStorage.java#L172-L176
   
   ### Error message and/or stacktrace
   
   > > Task :core:test
   > 
   > TestGroupMetaService > testInsertAlreadyExistsException() FAILED
   >     org.opentest4j.AssertionFailedError: Unexpected exception type thrown 
==> expected: <org.apache.gravitino.EntityAlreadyExistsException> but was: 
<java.io.IOException>
   >         at 
app//org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:65)
   >         at 
app//org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:37)
   >         at 
app//org.junit.jupiter.api.Assertions.assertThrows(Assertions.java:3082)
   >         at 
app//org.apache.gravitino.storage.relational.TestJDBCBackend.testInsertAlreadyExistsException(TestJDBCBackend.java:229)
   >         at 
java.base@17.0.14/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
   >         at 
java.base@17.0.14/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
   >         at 
java.base@17.0.14/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   >         at 
java.base@17.0.14/java.lang.reflect.Method.invoke(Method.java:569)
   >         at 
app//org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
   >         at 
app//org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
   >         at 
app//org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
   >         at 
app//org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
   >         at 
app//org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
   >         at 
app//org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
   >         at 
app//org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
   >         at 
app//org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
   >         at 
app//org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
   >         at 
app//org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
   >         at 
app//org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
   >         at 
app//org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
   >         at 
app//org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
   >         at 
app//org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
   >         at 
app//org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214)
   >         at 
app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
   >         at 
app//org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210)
   >         at 
app//org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
   >         at 
app//org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66)
   >         at 
app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
   >         at 
app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
   >         at 
app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
   >         at 
app//org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
   >         at 
app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
   >         at 
app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
   >         at 
app//org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
   >         at 
app//org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
   >         at 
java.base@17.0.14/java.util.ArrayList.forEach(ArrayList.java:1511)
   >         at 
app//org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
   >         at 
app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
   >         at 
app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
   >         at 
app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
   >         at 
app//org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
   >         at 
app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
   >         at 
app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
   >         at 
app//org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
   >         at 
app//org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
   >         at 
java.base@17.0.14/java.util.ArrayList.forEach(ArrayList.java:1511)
   >         at 
app//org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
   >         at 
app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
   >         at 
app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
   >         at 
app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
   >         at 
app//org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
   >         at 
app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
   >         at 
app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
   >         at 
app//org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
   >         at 
app//org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
   >         at 
app//org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
   >         at 
app//org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
   >         at 
app//org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
   >         at 
app//org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
   >         at 
app//org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
   >         at 
app//org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
   >         at 
app//org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
   >         at 
app//org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
   >         at 
app//org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
   >         at 
app//org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
   >         at 
app//org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
   >         at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:110)
   >         at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:90)
   >         at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:85)
   >         at 
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:62)
   >         at 
java.base@17.0.14/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
   >         at 
java.base@17.0.14/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
   >         at 
java.base@17.0.14/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   >         at 
java.base@17.0.14/java.lang.reflect.Method.invoke(Method.java:569)
   >         at 
org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
   >         at 
org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
   >         at 
org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
   >         at 
org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
   >         at jdk.proxy2/jdk.proxy2.$Proxy5.stop(Unknown Source)
   >         at 
org.gradle.api.internal.tasks.testing.worker.TestWorker$3.run(TestWorker.java:193)
   >         at 
org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
   >         at 
org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
   >         at 
org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
   >         at 
org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
   >         at 
org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:113)
   >         at 
org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:65)
   >         at 
app//worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
   >         at 
app//worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
   > 
   >         Caused by:
   >         java.io.IOException: 
java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'metalake-0' 
for key 'metalake_meta.uk_mn_del'
   >             at 
org.apache.gravitino.storage.relational.converters.PostgreSQLExceptionConverter.toGravitinoException(PostgreSQLExceptionConverter.java:44)
   >             at 
org.apache.gravitino.storage.relational.utils.ExceptionUtils.checkSQLException(ExceptionUtils.java:33)
   >             at 
org.apache.gravitino.storage.relational.service.MetalakeMetaService.insertMetalake(MetalakeMetaService.java:129)
   >             at 
org.apache.gravitino.storage.relational.JDBCBackend.insert(JDBCBackend.java:147)
   >             at 
org.apache.gravitino.storage.relational.TestJDBCBackend.lambda$testInsertAlreadyExistsException$1(TestJDBCBackend.java:229)
   >             at 
org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:55)
   >             ... 87 more
   > 
   >             Caused by:
   >             java.sql.SQLIntegrityConstraintViolationException: Duplicate 
entry 'metalake-0' for key 'metalake_meta.uk_mn_del'
   >                 at 
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117)
   >                 at 
com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
   >                 at 
com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
   >                 at 
com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:370)
   >                 at 
org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:95)
   >                 at 
org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:95)
   >                 at 
jdk.internal.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
   >                 at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   >                 at 
java.base/java.lang.reflect.Method.invoke(Method.java:569)
   >                 at 
org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
   >                 at jdk.proxy4/jdk.proxy4.$Proxy101.execute(Unknown Source)
   >                 at 
org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
   >                 at 
org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
   >                 at 
org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
   >                 at 
org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
   >                 at 
org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
   >                 at 
org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
   >                 at 
org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
   >                 at 
org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
   >                 at 
org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:152)
   >                 at 
org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85)
   >                 at 
jdk.proxy3/jdk.proxy3.$Proxy97.insertMetalakeMeta(Unknown Source)
   >                 at 
org.apache.gravitino.storage.relational.service.MetalakeMetaService.lambda$insertMetalake$3(MetalakeMetaService.java:125)
   >                 at 
org.apache.gravitino.storage.relational.utils.SessionUtils.doWithCommit(SessionUtils.java:47)
   >                 at 
org.apache.gravitino.storage.relational.service.MetalakeMetaService.insertMetalake(MetalakeMetaService.java:118)
   >                 ... 90 more
   
   ### How to reproduce
   
   `./gradlew :core:test`
   
   ### Additional context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@gravitino.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to