chiark / gitweb /
invoke: less drivel
[version-charset-test.git] / check
diff --git a/check b/check
index b9eac539ea58d4b50805dbf7e25d6f9b65cd97b1..290aac80f94270ac92c4d7794b8e6eb0331d249d 100755 (executable)
--- a/check
+++ b/check
@@ -2,26 +2,22 @@
 set -e
 set -o pipefail
 
-cpus=$(
-       perl -we '
-           use strict;
-           require Sys::CPU;
-           my $ncpus = Sys::CPU::cpu_count();
-           $ncpus *= 1.5;
-            print join " ", (0 .. $ncpus-1) or die $!;
-           print "\n" or die $!;
-       ' ||
-       echo 0 1 2
-)
-
-rm -rf stunt
-mkdir stunt
-cd stunt
+cpus='0 1'
+
+uid=`id -u`
+cd /var/run/user/$uid
+mkdir -p version-charset-test
+cd version-charset-test
+
+stunt=stunt$1
+rm -rf $stunt
+mkdir $stunt
+cd $stunt
 
 for cpu in $cpus; do
        mkdir c$cpu
        (cd c$cpu
-        git init)
+        git init -q)
 done
 
 #exec 3<&0 </dev/null
@@ -37,6 +33,7 @@ perl -we '
     our $file;
     our $count;
     our $batch=0;
+    our $total=0;
     our @tasks;
 
     my @freecpus = qw('"$cpus"');
@@ -48,7 +45,7 @@ perl -we '
        waitpid $pid, 0 == $pid or die $!;
        die "$oldbatch $?" if $?;
        unlink "b$oldbatch" or die "$oldbatch $!";
-        print STDERR "check completed $oldbatch [$pid] #$cpu\n";
+#        print STDERR "check completed $oldbatch [$pid] #$cpu\n";
        push @freecpus, $cpu;
     }
 
@@ -57,7 +54,7 @@ perl -we '
 
        close $file or die $!;
 
-        print STDERR "check closing $batch ($count)\n";
+#        print STDERR "check closing $batch ($count)\n";
 
        await_task unless @freecpus;
 
@@ -73,10 +70,11 @@ perl -we '
            exec qw(eatmydata git update-ref --stdin);
            die $!;
        }
-        print STDERR "check spawned $batch ($count) [$pid] #$cpu\n";
+#        print STDERR "check spawned $batch ($count) [$pid] #$cpu\n";
        push @tasks, [ $pid, $cpu, $batch ];
        $batch++;
        $file = undef;
+       $total += $count;
        $count = 0;
     }
 
@@ -85,10 +83,11 @@ perl -we '
         $file ||= new IO::File "b$batch", ">" or die $!;
         chomp;
        print $file "delete refs/tags/$_\n" or die $!;
-       $count++ < 100000 or complete_batch;
+       $count++ < 1000 or complete_batch;
     }
 #print STDERR "FOO\n";
     STDIN->error and die $!;
     complete_batch();
     await_task while @tasks;
+    print STDERR "check exiting (total=$total)\n";
 '