mirror of https://github.com/citusdata/citus.git
Configure valgrind command line arguments
parent
d6cb88a73a
commit
5de61ebf78
|
@ -51,7 +51,7 @@ check-multi: all tempinstall-main
|
||||||
|
|
||||||
check-multi-vg: all tempinstall-main
|
check-multi-vg: all tempinstall-main
|
||||||
$(pg_regress_multi_check) --load-extension=citus --valgrind \
|
$(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)
|
-- $(MULTI_REGRESS_OPTS) --schedule=$(citus_abs_srcdir)/multi_schedule $(EXTRA_TESTS)
|
||||||
|
|
||||||
check-isolation: all tempinstall-main
|
check-isolation: all tempinstall-main
|
||||||
|
|
|
@ -37,6 +37,7 @@ sub Usage()
|
||||||
print " --server-option Config option to pass to the server\n";
|
print " --server-option Config option to pass to the server\n";
|
||||||
print " --valgrind Run server via valgrind\n";
|
print " --valgrind Run server via valgrind\n";
|
||||||
print " --valgrind-path Path to the valgrind executable\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 " --pg_ctl-timeout Timeout for pg_ctl\n";
|
||||||
print " --connection-timeout Timeout for connecting to worker nodes\n";
|
print " --connection-timeout Timeout for connecting to worker nodes\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
|
@ -59,9 +60,10 @@ my %fdwServers = ();
|
||||||
my %functions = ();
|
my %functions = ();
|
||||||
my %operators = ();
|
my %operators = ();
|
||||||
my $valgrind = 0;
|
my $valgrind = 0;
|
||||||
my $valgrind_path = "valgrind";
|
my $valgrindPath = "valgrind";
|
||||||
my $pg_ctl_timeout = undef;
|
my $valgrindLogFile = "valgrind_test_log.txt";
|
||||||
my $connection_timeout = 5000;
|
my $pgCtlTimeout = undef;
|
||||||
|
my $connectionTimeout = 5000;
|
||||||
|
|
||||||
my $serversAreShutdown = "TRUE";
|
my $serversAreShutdown = "TRUE";
|
||||||
|
|
||||||
|
@ -77,9 +79,10 @@ GetOptions(
|
||||||
'load-extension=s' => \@extensions,
|
'load-extension=s' => \@extensions,
|
||||||
'server-option=s' => \@userPgOptions,
|
'server-option=s' => \@userPgOptions,
|
||||||
'valgrind' => \$valgrind,
|
'valgrind' => \$valgrind,
|
||||||
'valgrind-path=s' => \$valgrind_path,
|
'valgrind-path=s' => \$valgrindPath,
|
||||||
'pg_ctl-timeout=s' => \$pg_ctl_timeout,
|
'valgrind-log-file=s' => \$valgrindLogFile,
|
||||||
'connection-timeout=s' => \$connection_timeout,
|
'pg_ctl-timeout=s' => \$pgCtlTimeout,
|
||||||
|
'connection-timeout=s' => \$connectionTimeout,
|
||||||
'help' => sub { Usage() });
|
'help' => sub { Usage() });
|
||||||
|
|
||||||
# Update environment to include [DY]LD_LIBRARY_PATH/LIBDIR/etc -
|
# Update environment to include [DY]LD_LIBRARY_PATH/LIBDIR/etc -
|
||||||
|
@ -144,10 +147,12 @@ are present.
|
||||||
MESSAGE
|
MESSAGE
|
||||||
}
|
}
|
||||||
|
|
||||||
# valgrind starts slow, need to increase timeout
|
# If pgCtlTimeout is defined, we will set related environment variable.
|
||||||
if (defined $pg_ctl_timeout)
|
# 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
|
# 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";
|
or die "Could not create postgres wrapper at $bindir/postgres";
|
||||||
print $fh <<"END";
|
print $fh <<"END";
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
exec $valgrind_path \\
|
exec $valgrindPath \\
|
||||||
--quiet \\
|
--quiet \\
|
||||||
--suppressions=${postgresSrcdir}/src/tools/valgrind.supp \\
|
--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 \\
|
--leak-check=no \\
|
||||||
--error-exitcode=128 \\
|
|
||||||
--error-markers=VALGRINDERROR-BEGIN,VALGRINDERROR-END \\
|
--error-markers=VALGRINDERROR-BEGIN,VALGRINDERROR-END \\
|
||||||
|
--log-file=$valgrindLogFile \\
|
||||||
$bindir/postgres.orig \\
|
$bindir/postgres.orig \\
|
||||||
"\$@"
|
"\$@"
|
||||||
END
|
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.task_tracker_delay=10ms");
|
||||||
push(@pgOptions, '-c', "citus.remote_task_check_interval=1ms");
|
push(@pgOptions, '-c', "citus.remote_task_check_interval=1ms");
|
||||||
push(@pgOptions, '-c', "citus.shard_replication_factor=2");
|
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
|
# Add externally added options last, so they overwrite the default ones above
|
||||||
for my $option (@userPgOptions)
|
for my $option (@userPgOptions)
|
||||||
|
|
Loading…
Reference in New Issue