Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita0093a7

Browse files
author
Stepan Pesternikov
committed
job max run time error message
1 parent2225c2f commita0093a7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎test/perl/t/jobMaxRunTime.t

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $dbh->do($query);
2222
ok($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);
3434
ok($sth->execute())or (print$DBI::errstr ."\n"and$dbh->disconnect()and BAIL_OUT);
3535
my$job_id =$sth->fetchrow_array()and$sth->finish();
3636

37-
sleep130;
37+
sleep250;
3838
$query ="SELECT count(*) FROM test_results";
3939
$sth =$dbh->prepare($query);
4040
ok($sth->execute())or (print$DBI::errstr ."\n"and$dbh->disconnect()and BAIL_OUT);
@@ -48,6 +48,13 @@ $sth->bind_param(1, $job_id);
4848
ok($sth->execute(),$dbh->errstr)orprint$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($errorstreq"job timeout")orprint$DBI::errstr ."\n";
57+
5158
$query ="DELETE FROM test_results;";
5259
$dbh->do($query);
5360
ok($dbh->err == 0,$dbh->errstr)orprint$DBI::errstr ."\n";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp