tag 591111 patch
thanks

On Thu, Aug 05, 2010 at 11:43:07AM +0900, Ansgar Burchardt wrote:
> Lucas Nussbaum <lu...@lucas-nussbaum.net> writes:
> 
> > Source: libdbd-sqlite3-perl
> > Version: 1.29-2
> 
> >> t/07_error.t ............................. ok
> >> 
> >> #   Failed test at t/08_busy.t line 101.
> >> # Your testing environment might be too slow to pass this test: 
> >> DBD::SQLite::db do failed: disk I/O error at t/08_busy.t line 100, 
> >> <READER> line 1.

> This only happens with libsqlite3-dev 3.7.0-1, the test suite passes
> with the older 3.6.23.1-4.  Should we reassign this to libsqlite3?

No, I don't think so. I think it's just a libdbd-sqlite3-perl test suite
problem. Its child processes clean up database files while the parent
keeps them open. This used to work with earlier sqlite3 versions but
write locks now seem to do a stat() on the file and fail if it's missing.

I don't think writing to a deleted database file is useful in the real
world, so it should be enough to change the test suite. Patch attached.
-- 
Niko Tyni   nt...@debian.org
>From 89c8a661e61bbf0fb1d1e5050262390649e13f2a Mon Sep 17 00:00:00 2001
From: Niko Tyni <nt...@debian.org>
Date: Mon, 23 Aug 2010 08:15:15 +0300
Subject: [PATCH] Don't clean temporary files in child processes

As of SQLite 3.7.0, write locks try to stat() the database
file and fail with a 'Disk I/O error' if it is missing. This
breaks those tests that fork child processes (namely 08_busy.t
and t/28_schemachange.t) because the child process removes
the database file in the END block.

The fix is to disable the clean() function for child processes.

See <http://bugs.debian.org/591111>
---
 t/lib/Test.pm |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/t/lib/Test.pm b/t/lib/Test.pm
index 80e50ce..8d1be25 100644
--- a/t/lib/Test.pm
+++ b/t/lib/Test.pm
@@ -7,6 +7,7 @@ use Exporter   ();
 use File::Spec ();
 use Test::More ();
 
+my $parent;
 use vars qw{$VERSION @ISA @EXPORT @CALL_FUNCS};
 BEGIN {
 	$VERSION = '1.29';
@@ -15,6 +16,7 @@ BEGIN {
 
 	# Allow tests to load modules bundled in /inc
 	unshift @INC, 'inc';
+	$parent = $$;
 }
 
 # Always load the DBI module
@@ -22,6 +24,7 @@ use DBI ();
 
 # Delete temporary files
 sub clean {
+	return if $$ != $parent;
 	unlink( 'foo'         );
 	unlink( 'foo-journal' );
 }
-- 
1.7.1

Reply via email to