Skip to content

Commit d3fb35f

Browse files
author
Stepan Pesternikov
committed
remove 1 test
1 parent 77cf131 commit d3fb35f

File tree

5 files changed

+15
-90
lines changed

5 files changed

+15
-90
lines changed

test/perl/t/jobError.t

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ my $dbh = DBI->connect("dbi:Pg:dbname=$dbname; host=$host", "$username", "$passw
1717
{PrintError => 0});
1818
ok($dbh->err == 0) or (print $DBI::errstr and BAIL_OUT);
1919

20-
my $query = "SELECT schedule.clean_log();";
21-
$dbh->do($query);
22-
ok($dbh->err == 0) or (print $DBI::errstr . "\n" and $dbh->disconnect() and BAIL_OUT);
23-
24-
$query = "SELECT schedule.create_job(\'{ \"name\": \"Test\",
20+
my $query = "SELECT schedule.create_job(\'{ \"name\": \"Test\",
2521
\"cron\": \"* * * * *\",
2622
\"command\": \"aaaaaaaaaa;\",
2723
\"run_as\": \"tester\",

test/perl/t/jobLastStartAvailable.t

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ ok($sth->execute()) or (print $DBI::errstr and $dbh->disconnect() and BAIL_OUT);
5454
my $result = $sth->fetchrow_array() and $sth->finish();
5555
ok ($result == 0) or print "Count != 0\n";
5656

57+
$query = "SELECT count(*) FROM schedule.get_log() WHERE cron = $job_id AND status = 'error'";
58+
$sth = $dbh->prepare($query);
59+
ok($sth->execute()) or (print $DBI::errstr and $dbh->disconnect() and BAIL_OUT);
60+
61+
my $result = $sth->fetchrow_array() and $sth->finish();
62+
ok ($result > 0) or print "Count == 0\n";
63+
5764
$query = "SELECT schedule.deactivate_job(?)";
5865
$sth = $dbh->prepare($query);
5966
$sth->bind_param(1, $job_id);

test/perl/t/jobMaxInstances.t

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ 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-
sleep 120;
37+
sleep 180;
3838
$query = "SELECT schedule.deactivate_job(?)";
3939
$sth = $dbh->prepare($query);
4040
$sth->bind_param(1, $job_id);
4141
ok($sth->execute(), $dbh->errstr) or print $DBI::errstr . "\n";
4242
$sth->finish();
4343

44-
$query = "SELECT message FROM schedule.get_log() WHERE cron=$job_id AND status=\'error\' ORDER BY cron DESC LIMIT 1";
44+
$query = "SELECT message FROM schedule.get_log()
45+
WHERE cron=$job_id AND status=\'error\' AND message = 'max instances limit reached' LIMIT 1";
4546
my $sth = $dbh->prepare($query);
4647
ok($sth->execute()) or (print $DBI::errstr . "\n" and $dbh->disconnect() and BAIL_OUT);
4748
my $errorstr = $sth->fetchrow_array() and $sth->finish();

test/perl/t/jobMaxRunTime.t

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ok($dbh->err == 0) or (print $DBI::errstr . "\n" and $dbh->disconnect() and BAIL
2424
$query = "SELECT schedule.create_job(\'{ \"name\": \"Test 1\",
2525
\"cron\": \"*/3 * * * *\",
2626
\"commands\": [\"SELECT pg_sleep(120)\",
27-
\"INSERT INTO test_results (time_mark, commentary) VALUES(now(), ''createJob'')\"],
27+
\"INSERT INTO test_results (time_mark, commentary) VALUES(now(), ''jobMaxRunTime'')\"],
2828
\"run_as\": \"tester\",
2929
\"use_same_transaction\": \"true\",
3030
\"max_run_time\":\"00:01:00\"
@@ -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-
sleep 250;
37+
sleep 180;
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,7 +48,8 @@ $sth->bind_param(1, $job_id);
4848
ok($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";
51+
$query = "SELECT message FROM schedule.get_log()
52+
WHERE cron=$job_id AND status=\'error\' AND message = 'job timeout' LIMIT 1";
5253
my $sth = $dbh->prepare($query);
5354
ok($sth->execute()) or (print $DBI::errstr . "\n" and $dbh->disconnect() and BAIL_OUT);
5455

test/perl/t/jobOnStart.t

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)