Configure valgrind command line arguments

pull/1294/head
Burak Yucesoy 2017-04-12 12:49:19 +03:00
parent d6cb88a73a
commit 5de61ebf78
2 changed files with 19 additions and 14 deletions

View File

@ -51,7 +51,7 @@ check-multi: all tempinstall-main
check-multi-vg: all tempinstall-main
$(pg_regress_multi_check) --load-extension=citus --valgrind \
--pg_ctl-timeout=360 --connection-timeout=500000 --valgrind-path=valgrind \
--pg_ctl-timeout=360 --connection-timeout=500000 --valgrind-path=valgrind --valgrind-log-file=$(VALGRIND_LOG_FILE) \
-- $(MULTI_REGRESS_OPTS) --schedule=$(citus_abs_srcdir)/multi_schedule $(EXTRA_TESTS)
check-isolation: all tempinstall-main

View File

@ -37,6 +37,7 @@ sub Usage()
print " --server-option Config option to pass to the server\n";
print " --valgrind Run server via valgrind\n";
print " --valgrind-path Path to the valgrind executable\n";
print " --valgrind-log-file Path to the write valgrind logs\n";
print " --pg_ctl-timeout Timeout for pg_ctl\n";
print " --connection-timeout Timeout for connecting to worker nodes\n";
exit 1;
@ -59,9 +60,10 @@ my %fdwServers = ();
my %functions = ();
my %operators = ();
my $valgrind = 0;
my $valgrind_path = "valgrind";
my $pg_ctl_timeout = undef;
my $connection_timeout = 5000;
my $valgrindPath = "valgrind";
my $valgrindLogFile = "valgrind_test_log.txt";
my $pgCtlTimeout = undef;
my $connectionTimeout = 5000;
my $serversAreShutdown = "TRUE";
@ -77,9 +79,10 @@ GetOptions(
'load-extension=s' => \@extensions,
'server-option=s' => \@userPgOptions,
'valgrind' => \$valgrind,
'valgrind-path=s' => \$valgrind_path,
'pg_ctl-timeout=s' => \$pg_ctl_timeout,
'connection-timeout=s' => \$connection_timeout,
'valgrind-path=s' => \$valgrindPath,
'valgrind-log-file=s' => \$valgrindLogFile,
'pg_ctl-timeout=s' => \$pgCtlTimeout,
'connection-timeout=s' => \$connectionTimeout,
'help' => sub { Usage() });
# Update environment to include [DY]LD_LIBRARY_PATH/LIBDIR/etc -
@ -144,10 +147,12 @@ are present.
MESSAGE
}
# valgrind starts slow, need to increase timeout
if (defined $pg_ctl_timeout)
# If pgCtlTimeout is defined, we will set related environment variable.
# This is generally used with valgrind because valgrind starts slow and we
# need to increase timeout.
if (defined $pgCtlTimeout)
{
$ENV{PGCTLTIMEOUT} = "$pg_ctl_timeout";
$ENV{PGCTLTIMEOUT} = "$pgCtlTimeout";
}
# We don't want valgrind to run pg_ctl itself, as that'd trigger a lot
@ -172,13 +177,13 @@ sub replace_postgres
or die "Could not create postgres wrapper at $bindir/postgres";
print $fh <<"END";
#!/bin/bash
exec $valgrind_path \\
exec $valgrindPath \\
--quiet \\
--suppressions=${postgresSrcdir}/src/tools/valgrind.supp \\
--trace-children=yes --track-origins=yes --read-var-info=yes \\
--trace-children=yes --track-origins=yes --read-var-info=no \\
--leak-check=no \\
--error-exitcode=128 \\
--error-markers=VALGRINDERROR-BEGIN,VALGRINDERROR-END \\
--log-file=$valgrindLogFile \\
$bindir/postgres.orig \\
"\$@"
END
@ -229,7 +234,7 @@ push(@pgOptions, '-c', "citus.expire_cached_shards=on");
push(@pgOptions, '-c', "citus.task_tracker_delay=10ms");
push(@pgOptions, '-c', "citus.remote_task_check_interval=1ms");
push(@pgOptions, '-c', "citus.shard_replication_factor=2");
push(@pgOptions, '-c', "citus.node_connection_timeout=${connection_timeout}");
push(@pgOptions, '-c', "citus.node_connection_timeout=${connectionTimeout}");
# Add externally added options last, so they overwrite the default ones above
for my $option (@userPgOptions)