<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -28,7 +28,7 @@ WriteMakefile(
     AUTHOR       =&gt; 'Greg Sabino Mullane &lt;greg@endpoint.com&gt;',
     LICENSE      =&gt; 'BSD',
     NO_META      =&gt; 1,
-    clean        =&gt; { FILES =&gt; 'log.bucardo.* *~ *.tmp outgoingmail.*' },
+    clean        =&gt; { FILES =&gt; 'log.bucardo.* *~ *.tmp outgoingmail.* bucardo_test_database*/' },
 );
 
 package MY;
@@ -48,3 +48,10 @@ sub manifypods {
     $after .= qq{\t\$(NOECHO) \$(ECHO) Created Bucardo.pm.html and bucardo_ctl.html\n};
     return shift-&gt;SUPER::manifypods(@_) . $after;
 }
+
+sub clean {
+	my $string = shift-&gt;SUPER::clean(@_);
+	$string =~ s{\t}{\tperl t/98-cleanup\.t\n\t};
+	return $string;
+}
+</diff>
      <filename>Makefile.PL</filename>
    </modified>
    <modified>
      <diff>@@ -1,32 +1,27 @@
-#!/usr/bin/perl -- -*-cperl-*-
+#!perl
 
-## Cleanup all test remnants
+## Cleanup any mess we made
 
 use 5.008003;
 use strict;
 use warnings;
-use DBI;
-use Test::More tests =&gt; 5;
-use lib 't','.';
-use BucardoTesting;
-
-use vars qw/$SQL $sth $t/;
-
-pass(&quot;*** Cleaning up Bucardo testing artifacts&quot;);
-
-## Remove all temporary files
-pass('Removed all temporary files');
-## *.bc.tmp
-
-## Remove all test databases
-my $bct = BucardoTesting-&gt;new({name =&gt; 'cleanup'});
-$bct-&gt;drop_database('all');
-pass('Removed all test databases');
-
-## Remove all test users
-#$bct-&gt;drop_users('all');
-#pass('Removed all test users');
-
-## Shutdown the helper program
-pass('Shutdown the helper program');
+use Test::More tests =&gt; 1;
+
+for my $letter ('A'..'Z') {
+	my $dir = &quot;bucardo_test_database_$letter&quot;;
+	next if ! -d $dir;
+	my $pidfile = &quot;$dir/postmaster.pid&quot;;
+	next if ! -e $pidfile;
+	open my $fh, '&lt;', $pidfile or die qq{Could not open &quot;$pidfile&quot;: $!\n};
+	&lt;$fh&gt; =~ /^(\d+)/ or die qq{File &quot;$pidfile&quot; did not start with a number!\n};
+	my $pid = $1;
+	close $fh or die qq{Could not close &quot;$pidfile&quot;: $!\n};
+	kill 15 =&gt; $pid;
+	sleep 1;
+	if (kill 0 =&gt; $pid) {
+		kill 9 =&gt; $pid;
+	}
+}
+
+pass 'Test databases are shut down';
 </diff>
      <filename>t/98-cleanup.t</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>eea9856befbb395eb42b45884374d22fdbe587f0</id>
    </parent>
  </parents>
  <author>
    <name>Greg Sabino Mullane</name>
    <email>greg@endpoint.com</email>
  </author>
  <url>http://github.com/unilogic/bucardo/commit/35539751127f6ad74b82f9970baf388fdc622b5d</url>
  <id>35539751127f6ad74b82f9970baf388fdc622b5d</id>
  <committed-date>2009-05-11T10:43:28-07:00</committed-date>
  <authored-date>2009-05-11T10:43:28-07:00</authored-date>
  <message>Better cleanup of test databases.</message>
  <tree>daf2d20e58fce138403eec9a81958237fbbc0a5e</tree>
  <committer>
    <name>Greg Sabino Mullane</name>
    <email>greg@endpoint.com</email>
  </committer>
</commit>
