-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Describe the bug
I started yesterday with writing unittests using utPLSQL. Yesterday, everything worked fine but starting this afternoon I cannot use the sqldeveloper plugin to create coverage reports anymore(test run still works).
Executing the script results in:
EXECUTE dbms_session.reset_package;
SET SERVEROUTPUT ON SIZE UNLIMITED
CLEAR SCREEN
EXEC ut.run('[redacted]',ut_coverage_html_reporter())
Fehler beim Start in Zeile: 4 in Befehl -
BEGIN ut.run('[redacted]',ut_coverage_html_reporter()); END;
Fehlerbericht -
ORA-20000: ORU-10027: buffer overflow, limit of 1000000 bytes
ORA-06512: in "SYS.DBMS_OUTPUT", Zeile 32
ORA-06512: in "SYS.DBMS_OUTPUT", Zeile 97
ORA-06512: in "SYS.DBMS_OUTPUT", Zeile 112
ORA-06512: in "UNITTESTS.UT_OUTPUT_BUFFER_BASE", Zeile 59
ORA-06512: in "UNITTESTS.UT_OUTPUT_REPORTER_BASE", Zeile 80
ORA-06512: in "UNITTESTS.UT", Zeile 504
ORA-06512: in "UNITTESTS.UT", Zeile 623
ORA-06512: in Zeile 1
20000. 00000 - "%s"
*Cause: The stored procedure 'raise_application_error'
was called which causes this error to be generated.
*Action: Correct the problem as described in the error message or contact
the application administrator or DBA for more information.
Using the sqldeveloper menu entry the logging of sqldeveloper shows this log after a while:
Error when running code coverage: StatementCallback; uncategorized SQLException for SQL [BEGIN
ut.run(
a_paths => ut_varchar2_list(
'[redacted]'
),
a_reporter => ut_coverage_html_reporter()
);
END;
]; SQL state [72000]; error code [20000]; ORA-20000: ORU-10027: buffer overflow, limit of 1000000 bytes
ORA-06512: in "SYS.DBMS_OUTPUT", Zeile 32
ORA-06512: in "SYS.DBMS_OUTPUT", Zeile 97
ORA-06512: in "SYS.DBMS_OUTPUT", Zeile 112
ORA-06512: in "UNITTESTS.UT_OUTPUT_BUFFER_BASE", Zeile 59
ORA-06512: in "UNITTESTS.UT_OUTPUT_REPORTER_BASE", Zeile 80
ORA-06512: in "UNITTESTS.UT", Zeile 504
ORA-06512: in Zeile 2
; nested exception is java.sql.SQLException: ORA-20000: ORU-10027: buffer overflow, limit of 1000000 bytes
ORA-06512: in "SYS.DBMS_OUTPUT", Zeile 32
ORA-06512: in "SYS.DBMS_OUTPUT", Zeile 97
ORA-06512: in "SYS.DBMS_OUTPUT", Zeile 112
ORA-06512: in "UNITTESTS.UT_OUTPUT_BUFFER_BASE", Zeile 59
ORA-06512: in "UNITTESTS.UT_OUTPUT_REPORTER_BASE", Zeile 80
ORA-06512: in "UNITTESTS.UT", Zeile 504
ORA-06512: in Zeile 2
Provide version info
Information about utPLSQL and Database version,
12.1.0.2.0
12.1.0.2.0
PL/SQL-Prozedur erfolgreich abgeschlossen.
UT_VERSION
v3.1.10.3349
BANNER CON_ID
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production 0
PL/SQL Release 12.1.0.2.0 - Production 0
CORE 12.1.0.2.0 Production 0
TNS for Linux: Version 12.1.0.2.0 - Production 0
NLSRTL Version 12.1.0.2.0 - Production 0
PARAMETER VALUE
NLS_LANGUAGE GERMAN
NLS_TERRITORY GERMANY
NLS_CURRENCY ?
NLS_ISO_CURRENCY GERMANY
NLS_NUMERIC_CHARACTERS ,.
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD.MM.RR HH24:MI:SS
NLS_DATE_LANGUAGE GERMAN
NLS_SORT GERMAN
NLS_TIME_FORMAT HH24:MI:SSXFF
NLS_TIMESTAMP_FORMAT DD.MM.RR HH24:MI:SSXFF
PARAMETER VALUE
NLS_TIME_TZ_FORMAT HH24:MI:SSXFF TZR
NLS_TIMESTAMP_TZ_FORMAT DD.MM.RR HH24:MI:SSXFF TZR
NLS_DUAL_CURRENCY ?
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS CHAR
NLS_NCHAR_CONV_EXCP FALSE
17 Zeilen gewählt.
PORT_STRING
x86_64/Linux 2.4.xx
Information about client software
SQLDeveloper with installed utPlsql plugin
Expected behavior
I would expect that this call works and creates the coverage report.
Activity
PhilippSalvisberg commentedon Mar 12, 2020
This is a SQL Developer and SQLcli issue.
You can run the following successfully in SQL*Plus 19.5:
The result ends with:
If you run the same script in SQLcl 19.4 or SQL Developer 19.4 you get the following result:
It looks like SQLcl and SQL Developer limit the
DBMS_OUTPUT
to1000000
even if you setUNLIMITED
.@thatjeffsmith do you know about this restriction?
jgebal commentedon Mar 12, 2020
One way to fix this in the plugin would ne to use
select * from table (ut.run...)
function call instead of iding procedire call.That way you spool output of select instead of spooling dbms_output results.
PhilippSalvisberg commentedon Mar 12, 2020
@jgebal actually, utPLSQL for SQL Developer uses
sys.dbms_output.enable(NULL);
behind the scenes. This is equivalent toUNLIMITED
. So the following should work as well as a workaround:jgebal commentedon Mar 12, 2020
Ah. I thought it's issue with utPLSQL plugin, not with running from Worksheet.
@wolframhaussig
I assume you're all sorted with this issue as per solution provided by @PhilippSalvisberg
Closing.
wolframhaussig commentedon Mar 13, 2020
Hello, @jgebal , I tried @PhilippSalvisberg s proposal and it did not fix it - I still get the same error in the worksheet And you were right: I get the error both in the worksheet and from the plugin - maybe I should have made it more clear. The second error I added in the initial post is from the sqldeveloper plugin.
wolframhaussig commentedon Mar 13, 2020
@jgebal I cannot reopen the issue, would you be so kind to do it?
PhilippSalvisberg commentedon Mar 13, 2020
I checked on my 12.1.0.2.190716OJVMPSU instance. I ran the following script in SQL*Plus, SQLcl and SQL Developer worksheet successfully:
@wolframhaussig can you run this in your environment?
jgebal commentedon Mar 13, 2020
I'm transferring this issue to utPLSQL-SQLDeveloper, as it's related to HTML coverage report generation using utPLSQL plugin in SQLDeveloper .
PhilippSalvisberg commentedon Mar 13, 2020
Producing the code coverage report via
DBMS_OUTPUT
is a bad idea anyway. There is no way to suppress unwanted dbms_output produced by the test run itself. Hence I'm going to change the call as @jgebal has suggested to something likeselect ... from table(ut.run...)
. This should solve this issue.fedor-khv commentedon Oct 5, 2022
проблема в том, что у ut3 своя сессия, которая и имеет ограничения на свой вывод в 20000 байт. нужно создавать свой метод run, в котором нужно снять это ограничение:
create procedure run_run (si_input varchar2) as
buff ut_varchar2_rows := ut_varchar2_rows();
begin
for rec in (select t.column_value raw from table (ut.run(si_input)) t) loop
ut_utils.append_to_list(buff, rec.raw);
end loop;
end;
затем, просто пользуем run_run('[redacted]',ut_coverage_html_reporter())
должно сработать