★ wanayoo — archive 1999 https://github.com/utPLSQL/utPLSQL/issues/1094Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on call of coverage stop in java #1094

Open
ksawerykarwacki opened this issue Aug 23, 2020 · 5 comments
Open

Error on call of coverage stop in java #1094

ksawerykarwacki opened this issue Aug 23, 2020 · 5 comments
Labels

Comments

@ksawerykarwacki
Copy link

@ksawerykarwacki ksawerykarwacki commented Aug 23, 2020

I'm trying to introduce code coverage in my integration tests. Unfortunately every time I try to call ut_runner.coverage_stop() for the first time I get error listed below and no coverage is present on report generation if that was the only call. Of course starting coverage at later stage breaks some unique constraint on duplicating run id.

It is enough to wrap call in try/catch block and rerun it in catch to get everything back to normal but nevertheless it seems strange.

My DB is Oracle 12c Standard Edition docker image build using official scripts. Schema and utplsql are installed on the PDB.

`PreparedStatementCallback; uncategorized SQLException for SQL [call ut_runner.coverage_stop()]; SQL state [99999]; error code [8402]; ORA-08402: error executing PL/SQL code coverage
ORA-06512: at "SYS.DBMS_PLSQL_CODE_COVERAGE", line 148
ORA-06512: at "UT3.UT_COVERAGE_HELPER_BLOCK", line 38
ORA-06512: at "UT3.UT_COVERAGE", line 203
ORA-06512: at "UT3.UT_RUNNER", line 278
; nested exception is java.sql.SQLException: ORA-08402: error executing PL/SQL code coverage
ORA-06512: at "SYS.DBMS_PLSQL_CODE_COVERAGE", line 148
ORA-06512: at "UT3.UT_COVERAGE_HELPER_BLOCK", line 38
ORA-06512: at "UT3.UT_COVERAGE", line 203
ORA-06512: at "UT3.UT_RUNNER", line 278

org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [call ut_runner.coverage_stop()]; SQL state [99999]; error code [8402]; ORA-08402: error executing PL/SQL code coverage
ORA-06512: at "SYS.DBMS_PLSQL_CODE_COVERAGE", line 148
ORA-06512: at "UT3.UT_COVERAGE_HELPER_BLOCK", line 38
ORA-06512: at "UT3.UT_COVERAGE", line 203
ORA-06512: at "UT3.UT_RUNNER", line 278
; nested exception is java.sql.SQLException: ORA-08402: error executing PL/SQL code coverage
ORA-06512: at "SYS.DBMS_PLSQL_CODE_COVERAGE", line 148
ORA-06512: at "UT3.UT_COVERAGE_HELPER_BLOCK", line 38
ORA-06512: at "UT3.UT_COVERAGE", line 203
ORA-06512: at "UT3.UT_RUNNER", line 278

at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1443)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:633)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:862)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:883)
at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:321)
at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:326)
at com.aptitudesoftware.taf.revstream.config.SessionManager.stopCoverage(SessionManager.java:197)
at com.aptitudesoftware.taf.revstream.api.EngineService.stopCoverage(EngineService.java:61)
at com.aptitudesoftware.taf.revstream.api.RevStream.stopCoverage(RevStream.java:37)
at com.aptitudesoftware.taf.revstream.base.BaseTest.afterSuite(BaseTest.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:425)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.runTests(TestNGTestClassProcessor.java:141)
at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.stop(TestNGTestClassProcessor.java:90)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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 com.sun.proxy.$Proxy2.stop(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:133)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.lang.Thread.run(Thread.java:748)

Caused by: java.sql.SQLException: ORA-08402: error executing PL/SQL code coverage
ORA-06512: at "SYS.DBMS_PLSQL_CODE_COVERAGE", line 148
ORA-06512: at "UT3.UT_COVERAGE_HELPER_BLOCK", line 38
ORA-06512: at "UT3.UT_COVERAGE", line 203
ORA-06512: at "UT3.UT_RUNNER", line 278

at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494)
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:446)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1054)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:623)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:226)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:59)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:910)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1119)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3780)
at oracle.jdbc.driver.T4CPreparedStatement.executeInternal(T4CPreparedStatement.java:1343)
at oracle.jdbc.driver.OraclePreparedStatement.executeLargeUpdate(OraclePreparedStatement.java:3865)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3845)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1061)
at org.springframework.jdbc.core.JdbcTemplate.lambda$update$0(JdbcTemplate.java:867)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:617)
... 53 more

Caused by: Error : 8402, Position : 5, Sql = call ut_runner.coverage_stop(), OriginalSql = call ut_runner.coverage_stop(), Error Msg = ORA-08402: error executing PL/SQL code coverage
ORA-06512: at "SYS.DBMS_PLSQL_CODE_COVERAGE", line 148
ORA-06512: at "UT3.UT_COVERAGE_HELPER_BLOCK", line 38
ORA-06512: at "UT3.UT_COVERAGE", line 203
ORA-06512: at "UT3.UT_RUNNER", line 278

at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:498)
... 69 more`
@pesse
Copy link
Member

@pesse pesse commented Nov 12, 2020

Hey @ksawerykarwacki - which client do you use? Have you tried utPLSQL-cli?

@ksawerykarwacki
Copy link
Author

@ksawerykarwacki ksawerykarwacki commented Nov 13, 2020

I'm running call ut_runner.coverage_stop() using update method on jdbctemplate in my java code.

@pesse
Copy link
Member

@pesse pesse commented Nov 13, 2020

As far as I know, this is not part of the official documentation and not meant to be used in that way.
Is there a reason why you don't use the existing tools like utPLSQL-cli or running the coverage reporters?

Maybe @PhilippSalvisberg or @jgebal can give some insights

@ksawerykarwacki
Copy link
Author

@ksawerykarwacki ksawerykarwacki commented Nov 13, 2020

@pesse please check #1025 for reasons why I call it that way. Also I see that 3.1.11 is still not officially released so this issue is pretty much for prerelease code.

@pesse
Copy link
Member

@pesse pesse commented Nov 13, 2020

Ah, okay, I see - this context is important - good we have a reference now :)
I'll label this issue with "discussion", because it's not really an issue of utPLSQL but rather experimental :)

@pesse pesse added the discussion label Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.