Allow for tests to run in parallel (simultaneously from multiple checkouts)
[dbsrgits/DBIx-Class.git] / t / storage / debug.t
index 632f370..6d8e94c 100644 (file)
@@ -14,7 +14,7 @@ BEGIN { delete @ENV{qw(DBIC_TRACE DBIC_TRACE_PROFILE DBICTEST_SQLITE_USE_FILE)}
 
 my $schema = DBICTest->init_schema();
 
-my $lfn = file('t/var/sql.log');
+my $lfn = file("t/var/sql-$$.log");
 unlink $lfn or die $!
   if -e $lfn;
 
@@ -49,6 +49,10 @@ $schema->storage->debugfh(undef);
   $schema->storage->debugobj->debugfh(undef)
 }
 
+END {
+  unlink $lfn;
+}
+
 open(STDERRCOPY, '>&STDERR');
 close(STDERR);
 dies_ok {