summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Berg2016-06-07 20:57:28 +0000
committerChristoph Berg2016-06-07 20:57:28 +0000
commit596c506ed0b784b313cf1aeee7bb2d114c880d9e (patch)
tree66d83db9373ce53b495bbfb5b57a6a887a249396
parentfd9eb2820b5bc7a45b9137c2c0e0d9a55141cb67 (diff)
t/02_replicate_row.t: wait for the forks, and sleep a bit longer
Hopefully this will make the test more reliable.
-rw-r--r--t/02_replicate_row.t9
1 files changed, 6 insertions, 3 deletions
diff --git a/t/02_replicate_row.t b/t/02_replicate_row.t
index 84f610807..d8a63f97a 100644
--- a/t/02_replicate_row.t
+++ b/t/02_replicate_row.t
@@ -7,7 +7,6 @@ use strict;
use warnings;
use Data::Dumper;
use Test::More tests => 19;
-use Time::HiRes qw(usleep);
use lib 't','.';
use CP_Testing;
@@ -120,6 +119,7 @@ else {
$dbh2->commit();
exit;
}
+wait;
$t=qq{$S works when rows match, reports proper delay};
$dbh->commit();
@@ -137,20 +137,22 @@ else {
$dbh2->commit();
exit;
}
+wait;
$t=qq{$S works when rows match, with MRTG output};
$dbh->commit();
if (fork) {
like ($cp->run('DB2replicate-row', '-c 20 --output=MRTG -repinfo=reptest,id,1,foo,yin,yang'),
- qr{^[12]\n0\n\n\n}, $t);
+ qr{^[1-5]\n0\n\n\n}, $t);
}
else {
- usleep 500_000; # 0.5s
+ sleep 1;
$SQL = q{UPDATE reptest SET foo = 'yin' WHERE id = 1};
$dbh2->do($SQL);
$dbh2->commit();
exit;
}
+wait;
$t=qq{$S works when rows match, with simple output};
$dbh->commit();
@@ -167,6 +169,7 @@ else {
$dbh2->commit();
exit;
}
+wait;
$dbh2->disconnect();