★ wanayoo — archive 1999 https://github.com/utPLSQL/utPLSQL/issues/513Nouvelle 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

Tigger ut run with coverage from the same sql session multiple times, only the first run create new runid #513

Closed
email2ying opened this issue Nov 14, 2017 · 7 comments

Comments

@email2ying
Copy link

@email2ying email2ying commented Nov 14, 2017

Steps to reproduce:

  1. login to db, run a ut with coverage enabled
  2. new run_id created in PLSQL_PROFILER_RUNS
  3. run the ut again from same session
  4. no new run_id created in PLSQL_PROFILER_RUNS, the same coverage result as the first run returns
@jgebal jgebal added this to the v3.0.5 milestone Nov 14, 2017
@jgebal jgebal added the bug label Nov 14, 2017
@jgebal
Copy link
Member

@jgebal jgebal commented Nov 15, 2017

I did some testing and cannot reproduce on Oracle 12.

var x varchar2;
begin
  :x := to_char(sysdate,'yyyy-mm-dd hh24.mi.ss');
  dbms_output.put_line('Start date is:'||:x);
end;
/

begin
  ut.run(ut_coverage_sonar_reporter());
end;
/

begin
  ut.run(ut_coverage_sonar_reporter());
end;
/

select case when count(1) = 2 then 'OK' else 'ERROR' end||' expected 2, got '||count(1) as status
  from plsql_profiler_runs where run_date >= to_date(:x,'yyyy-mm-dd hh24.mi.ss');

The above, gives following results:

Start date is:2017-11-15 07.56.33


PL/SQL procedure successfully completed.

<coverage version="1">
</coverage>


PL/SQL procedure successfully completed.

<coverage version="1">
</coverage>


PL/SQL procedure successfully completed.

OK expected 2, got 2
@email2ying
Copy link
Author

@email2ying email2ying commented Nov 15, 2017

I got this issue from oracle 11.2. Maybe that is the reason.

@pesse
Copy link
Member

@pesse pesse commented Nov 15, 2017

Can you tell us which version of utPLSQL you use?

@email2ying
Copy link
Author

@email2ying email2ying commented Nov 15, 2017

utPLSQL - Version v3.0.2.938

@jgebal
Copy link
Member

@jgebal jgebal commented Nov 15, 2017

It is v3.0.2

  • Can you check and see if reset package state helps
  • can you check if executing dbms_profiler.stop helps?
  • check if the same issue occurs when you run the same commands from SQLPLUS
@email2ying
Copy link
Author

@email2ying email2ying commented Nov 15, 2017

reset package state helps , but it somehow repressed the dbms_output
dbms_profiler.stop_profiler doesn't help
Seems issue when running same commands from sqlplus

@jgebal jgebal removed this from the v3.0.5 milestone Nov 15, 2017
@jgebal
Copy link
Member

@jgebal jgebal commented Nov 15, 2017

@email2ying
I've checked again on 11.2.0.2 XE using v3.0.2
There was an undocumented bug in coverage reporter. It was already fixed in v3.0.3 as part of #417.

Yesterday I was checking using develop version of the framework - that is why I could not see the issue occur.

Once you get v3.0.3 or above installed -> it will work fine.

@jgebal jgebal removed the bug label Nov 15, 2017
@jgebal jgebal closed this Nov 15, 2017
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
3 participants
You can’t perform that action at this time.