[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Should this test pass?

From: Joe Swatosh <joe.swatosh_at_gmail.com>
Date: 2007-01-09 16:31:39 CET

Hi Brane,

On 1/9/07, Branko Čibej <brane@xbc.nu> wrote:
> Joe Swatosh wrote:
> > Hi All,
> > As I've been trying to get the Ruby bindings tests to pass on windows,
> > I ran into a failing test. If I changed from BDB to FSFS the Ruby
> > version of the test passes.
> >
> > I rewrote it as a C test, just to make sure that Ruby wasn't involved
> > at all and sure enough the test below fails, but if the fs_type is
> > changed to fsfs it passes.
> >
> > Perhaps I've screwed up the build somehow? Screwed up somehow that
> > wasn't detected by the existing tests?
>
> You don't say how the test fails, but I'm pretty sure you can't delete a
> BDB filesystem while it's still open.
>
> -- Brane
>

I realized this morning that this was a pretty boneheaded report.
Let's see if I can do better.

With this patch:
Index: svn-trunk-wc/subversion/tests/libsvn_fs/fs-test.c
===================================================================
--- svn-trunk-wc/subversion/tests/libsvn_fs/fs-test.c (revision 22939)
+++ svn-trunk-wc/subversion/tests/libsvn_fs/fs-test.c (working copy)
@@ -4501,6 +4501,28 @@
}

+static svn_error_t *
+test_delete_fs(const char **msg,
+ svn_boolean_t msg_only,
+ svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_fs_t *fs;
+ const char *name = "test-fs-deletion";
+ apr_hash_t *fs_config = apr_hash_make(pool);
+ apr_hash_set(fs_config, SVN_FS_CONFIG_BDB_TXN_NOSYNC,
+ APR_HASH_KEY_STRING, "1");
+ apr_hash_set(fs_config, SVN_FS_CONFIG_FS_TYPE,
+ APR_HASH_KEY_STRING,
+ opts->fs_type);
+ *msg = "create a file system then destroy it";
+ if (msg_only)
+ return SVN_NO_ERROR;
+ SVN_ERR(svn_fs_create(&fs, name, fs_config, pool));
+ SVN_ERR(svn_fs_delete_fs(name, pool));
+ return SVN_NO_ERROR;
+}
+
/* ------------------------------------------------------------------------ */

/* The test table. */
@@ -4539,5 +4561,6 @@
     SVN_TEST_PASS(verify_checksum),
     SVN_TEST_PASS(closest_copy_test),
     SVN_TEST_PASS(root_revisions),
+ SVN_TEST_PASS(test_delete_fs),
     SVN_TEST_NULL
   };

=============================

I get these results:

D:\SVN\src-trunk\Release>subversion\tests\libsvn_fs\fs-test --fs-type=fsfs 31
PASS: fs-test 31: create a file system then destroy it

D:\SVN\src-trunk\Release>subversion\tests\libsvn_fs\fs-test --fs-type=bdb 31
svn_tests: Can't remove 'test-fs-deletion\changes'
svn_tests: Can't set file 'test-fs-deletion\changes' read-write:
Access is denied.
FAIL: fs-test 31: create a file system then destroy it

==============================

The original error from the Ruby test looked like this:

  2) Error:
test_create(SvnFsTest):
Svn::Error: D:\SVN\src-trunk\subversion\libsvn_subr\io.c:1800 Can't
remove 'test\tmp\fs\changes'
Can't set file 'test\tmp\fs\changes' read-write: Access is denied.
    D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/util.rb:68:in
`svn_fs_delete_fs'
    D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/util.rb:68:in `delete_fs'
    D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/fs.rb:31:in `delete'
    D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/test_fs.rb:40:in
`test_create'

==============

I instrumented svn_io_remove_dir. I observed it deleting each of the
files, then rewinding the dir and trying to delete the first file it
had deleted the first time iterating the directory. Since the
directory is empty, it errors trying to delete a non-existent file.

Since the frayed edge that started me trying to unravel all this was
an (I assume) test that passes for kou, I was sort of assuming this
should work on Windows too.

Building trunk with VC6 SP6 on Windows XP with
swigwin-1.3.24.zip
httpd-2.0.59-win32-src.zip
openssl-0.9.7d.tar.gz
db-4.4.20-win32.zip
neon-0.26.1.tar.gz
svn-win32-libintl.zip

I hope a little more detail helps,

--
Joe Swatosh
Received on Tue Jan 9 16:31:47 2007

This is an archived mail posted to the Subversion Dev mailing list.