Implement --utc.

This commit is contained in:
Daniel Nichter
2013-01-22 16:51:33 -07:00
parent ca8fc5e47e
commit 2cc48cb139
2 changed files with 13 additions and 12 deletions

View File

@@ -89,11 +89,11 @@ PerconaTest::wait_for_table($slave1_dbh, 'test.heartbeat', 'server_id=12345');
my $slave1_dsn = $sb->dsn_for('slave1');
# Using full_output here to work around a Perl bug: Only the first explicit
# tzset works.
($output) = output(sub {
($output) = full_output(sub {
local $ENV{TZ} = '-09:00';
tzset();
pt_heartbeat::main($slave1_dsn, qw(--database test --table heartbeat),
qw(--check --master-server-id), $master_port)
qw(--utc --check --master-server-id), $master_port)
});
# If the servers use UTC then the lag should be 0.00, or at least
@@ -102,12 +102,11 @@ my $slave1_dsn = $sb->dsn_for('slave1');
like(
$output,
qr/\A\d.\d{2}$/,
"Bug 886059: pt-heartbeat doesn't get confused with differing timezones"
"--utc bypasses time zone differences (bug 886059, bug 1099665)"
);
stop_all_instances();
# #############################################################################
# pt-heartbeat 2.1.8 doesn't use precision/sub-second timestamps
# https://bugs.launchpad.net/percona-toolkit/+bug/1103221