use strict;
use warnings;
use PostgresNode;
use TestLib;
use Test::More;
use Config;

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();

my $node = get_new_node('master');
$node->init();

$node->start;

diag( $node->safe_psql('postgres', 'select version();') . "\n" );

$node->command_ok(
	[ qw(pgbench --initialize --scale=10) ],
	  'pgbench finished without errors');

#$node->stop;

for ( my $i = 0; $i < 100000; $i++ ) {
#	$node->start;
#	diag( "started $i (1)\n" );	

#	$node->command_ok(
#		[ qw(pgbench --progress=5 --transactions=1000 --jobs=5 --client=5) ],
#		  'pgbench finished without errors');

#	$node->stop;
#	diag( "stopped $i (1)\n" );	

#	$node->start;
#	diag( "started $i (2)\n" );	

# $node->command_ok(
#		[ qw(pgbench --progress=5 --transactions=10 --jobs=5 --client=5) ],
#		  'pgbench finished without errors');

	$node->restart;
	diag( "restarted $i\n" );	

#	$node->command_ok(
#		[ qw(pgbench --progress=5 --transactions=1000 --jobs=5 --client=5) ],
#		  'pgbench finished without errors');

#	$node->stop;
#	diag( "stopped $i (2)\n" );	
	($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
	diag( sprintf("%02d:%02d:%02d", $hour, $min, $sec) );
}

ok( 1 eq 1, 'dummy test' );

done_testing();
