@@ -22,7 +22,7 @@ $dbh->do($query);
2222ok($dbh -> err == 0)or (print $DBI::errstr ." \n " and $dbh -> disconnect()and BAIL_OUT);
2323
2424$query =" SELECT schedule.create_job(\' {\" name\" :\" Test 1\" ,
25- \" cron\" :\" * * * * *\" ,
25+ \" cron\" :\" */3 * * * *\" ,
2626\" commands\" : [\" SELECT pg_sleep(120)\" ,
2727\" INSERT INTO test_results (time_mark, commentary) VALUES(now(), ''createJob'')\" ],
2828\" run_as\" :\" tester\" ,
@@ -34,7 +34,7 @@ my $sth = $dbh->prepare($query);
3434ok($sth -> execute())or (print $DBI::errstr ." \n " and $dbh -> disconnect()and BAIL_OUT);
3535my $job_id =$sth -> fetchrow_array()and $sth -> finish();
3636
37- sleep 130 ;
37+ sleep 250 ;
3838$query =" SELECT count(*) FROM test_results" ;
3939$sth =$dbh -> prepare($query );
4040ok($sth -> execute())or (print $DBI::errstr ." \n " and $dbh -> disconnect()and BAIL_OUT);
@@ -48,6 +48,13 @@ $sth->bind_param(1, $job_id);
4848ok($sth -> execute(),$dbh -> errstr)or print $DBI::errstr ." \n " ;
4949$sth -> finish();
5050
51+ $query =" SELECT message FROM schedule.get_log() WHERE cron=$job_id AND status=\' error\' ORDER BY cron DESC LIMIT 1" ;
52+ my $sth =$dbh -> prepare($query );
53+ ok($sth -> execute())or (print $DBI::errstr ." \n " and $dbh -> disconnect()and BAIL_OUT);
54+
55+ my $errorstr =$sth -> fetchrow_array()and $sth -> finish();
56+ ok($errorstr eq " job timeout" )or print $DBI::errstr ." \n " ;
57+
5158$query =" DELETE FROM test_results;" ;
5259$dbh -> do($query );
5360ok($dbh -> err == 0,$dbh -> errstr)or print $DBI::errstr ." \n " ;