@@ -290,23 +290,23 @@ create or replace package body coverage_helper is
290290 ut3_develop.ut_runner.coverage_stop();
291291 end;
292292
293- function get_job_status(a_job_name varchar2, a_job_started_after timestamp with time zone) return varchar2 is
294- l_status varchar2(1000) ;
293+ function get_job_status(a_job_name varchar2, a_job_started_after timestamp with time zone) return user_scheduler_job_run_details%rowtype is
294+ l_result user_scheduler_job_run_details%rowtype ;
295295 begin
296296 begin
297- select status into l_status
297+ select * into l_result
298298 from user_scheduler_job_run_details
299299 where job_name = upper(a_job_name)
300300 and req_start_date >= a_job_started_after;
301301 exception
302302 when no_data_found then
303303 null;
304304 end;
305- return l_status ;
305+ return l_result ;
306306 end;
307307
308308 procedure run_job_and_wait_for_finish(a_job_action varchar2) is
309- l_status varchar2(1000) ;
309+ l_job_run_info user_scheduler_job_run_details%rowtype ;
310310 l_job_name varchar2(30);
311311 l_timestamp timestamp with time zone := current_timestamp;
312312 i integer := 0;
@@ -324,14 +324,14 @@ create or replace package body coverage_helper is
324324 auto_drop => TRUE,
325325 comments => 'one-time-job'
326326 );
327- while (l_status is null or l_status not in ('SUCCEEDED','FAILED')) and i < 300 loop
328- l_status := get_job_status( l_job_name, l_timestamp );
327+ while (l_job_run_info.status is null or l_job_run_info.status not in ('SUCCEEDED','FAILED')) and i < 6000 loop
328+ l_job_run_info := get_job_status( l_job_name, l_timestamp );
329329 dbms_lock.sleep(0.1);
330330 i := i + 1;
331331 end loop;
332332 commit;
333- if nvl(l_status ,'null') <> 'SUCCEEDED' then
334- raise_application_error(-20000, 'Running a scheduler job failed' );
333+ if nvl(l_job_run_info.status ,'null') <> 'SUCCEEDED' then
334+ raise_application_error(-20000, 'Scheduler job '''||l_job_name||''', status='''||l_job_run_info.status||'''. Additional info: '||l_job_run_info.additional_info );
335335 end if;
336336 end;
337337
0 commit comments