projects
/
invirt/third/libt4.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Partially fixed a bug in the test suite that led to test runs randomly failing.
[invirt/third/libt4.git]
/
rsm_tester.pl
diff --git
a/rsm_tester.pl
b/rsm_tester.pl
index
7f73505
..
3d94744
100755
(executable)
--- a/
rsm_tester.pl
+++ b/
rsm_tester.pl
@@
-67,7
+67,7
@@
sub randports {
my $num = shift;
my @p = ();
for( my $i = 0; $i < $num; $i++ ) {
my $num = shift;
my @p = ();
for( my $i = 0; $i < $num; $i++ ) {
- push( @p, int(rand(54000))+10000 );
+ push( @p, int(rand(54000/2))*2+10000 );
}
my @sp = sort { $a <=> $b } @p;
return @sp;
}
my @sp = sort { $a <=> $b } @p;
return @sp;
@@
-159,8
+159,8
@@
sub wait_for_view_change {
my $start = time();
while( (get_num_views( $log, $including ) < $num_views) and
($start + $timeout > time()) ) {
my $start = time();
while( (get_num_views( $log, $including ) < $num_views) and
($start + $timeout > time()) ) {
- my $lastv = `grep done $log | tail -n 1`;
- chomp $lastv;
+ my $lastv = `grep done $log | tail -n 1`;
+ chomp $lastv;
print " Waiting for $including to be present in >=$num_views views in $log (Last view: $lastv)\n";
sleep 1;
}
print " Waiting for $including to be present in >=$num_views views in $log (Last view: $lastv)\n";
sleep 1;
}
@@
-220,10
+220,10
@@
sub start_nodes ($$){
my $command = shift;
for (my $i = 0; $i < $n; $i++) {
my $command = shift;
for (my $i = 0; $i < $n; $i++) {
- if ($command eq "ls") {
- @pid = (@pid, spawn_ls($p[0],$p[$i]));
- print "Start lock_server on $p[$i]\n";
- }
+ if ($command eq "ls") {
+ @pid = (@pid, spawn_ls($p[0],$p[$i]));
+ print "Start lock_server on $p[$i]\n";
+ }
sleep 1;
my @vv = @p[0..$i];
sleep 1;
my @vv = @p[0..$i];
@@
-417,7
+417,7
@@
if ($do_run[5]) {
foreach my $port (@lastv) {
wait_for_view_change(paxos_log($port), $in_views{$port}+1, $port, 20);
}
foreach my $port (@lastv) {
wait_for_view_change(paxos_log($port), $in_views{$port}+1, $port, 20);
}
- sleep 10;
+ sleep 10;
# now check the paxos logs and make sure the logs go through the right
# views
# now check the paxos logs and make sure the logs go through the right
# views
@@
-547,7
+547,7
@@
if ($do_run[7]) {
if ($do_run[8]) {
print "test8: start 3-process lock service\n";
if ($do_run[8]) {
print "test8: start 3-process lock service\n";
- start_nodes(3,"ls");
+ start_nodes(3,"ls");
print "Start lock_tester $p[0]\n";
$t = spawn("./lock_tester", $p[0]);
print "Start lock_tester $p[0]\n";
$t = spawn("./lock_tester", $p[0]);
@@
-566,7
+566,7
@@
if ($do_run[8]) {
if ($do_run[9]) {
print "test9: start 3-process rsm, kill second slave while lock_tester is running\n";
if ($do_run[9]) {
print "test9: start 3-process rsm, kill second slave while lock_tester is running\n";
- start_nodes(3,"ls");
+ start_nodes(3,"ls");
print "Start lock_tester $p[0]\n";
$t = spawn("./lock_tester", $p[0]);
print "Start lock_tester $p[0]\n";
$t = spawn("./lock_tester", $p[0]);
@@
-596,7
+596,7
@@
if ($do_run[9]) {
if ($do_run[10]) {
print "test10: start 3-process rsm, kill second slave and restarts it later while lock_tester is running\n";
if ($do_run[10]) {
print "test10: start 3-process rsm, kill second slave and restarts it later while lock_tester is running\n";
- start_nodes(3,"ls");
+ start_nodes(3,"ls");
print "Start lock_tester $p[0]\n";
$t = spawn("./lock_tester", $p[0]);
print "Start lock_tester $p[0]\n";
$t = spawn("./lock_tester", $p[0]);
@@
-634,7
+634,7
@@
if ($do_run[10]) {
if ($do_run[11]) {
print "test11: start 3-process rsm, kill primary while lock_tester is running\n";
if ($do_run[11]) {
print "test11: start 3-process rsm, kill primary while lock_tester is running\n";
- start_nodes(3,"ls");
+ start_nodes(3,"ls");
print "Start lock_tester $p[0]\n";
$t = spawn("./lock_tester", $p[0]);
print "Start lock_tester $p[0]\n";
$t = spawn("./lock_tester", $p[0]);