Where are the threads created that are described in the log message? ----- Oorspronkelijk bericht ----- Van: i...@apache.org Verzonden: zondag 22 november 2009 12:47 Aan: comm...@subversion.apache.org Onderwerp: svn commit: r883062 - /subversion/trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c
Author: ivan Date: Sun Nov 22 11:47:32 2009 New Revision: 883062 URL: http://svn.apache.org/viewvc?rev=883062&view=rev Log: Add test for situation when one thread tries to get/set revprop while repository being packed. * subversion/tests/libsvn_fs_fs/fs-pack-test.c (get_set_revprop_packed_fs): New test. (test_funcs): Add get_set_revprop_packed_fs to test list, mark it as XFail. Modified: subversion/trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c Modified: subversion/trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c?rev=883062&r1=883061&r2=883062&view=diff ============================================================================== --- subversion/trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c (original) +++ subversion/trunk/subversion/tests/libsvn_fs_fs/fs-pack-test.c Sun Nov 22 11:47:32 2009 @@ -28,6 +28,7 @@ #include "../../libsvn_fs_fs/fs.h" #include "svn_pools.h" +#include "svn_props.h" #include "svn_fs.h" #include "../svn_test_fs.h" @@ -341,6 +342,52 @@ } #undef REPO_NAME +/* Get/set revprop while repository is being packed in background. */ +#define REPO_NAME "test-get-set-revprop-packed-fs" +#define SHARD_SIZE 4 +#define MAX_REV 1 +static svn_error_t * +get_set_revprop_packed_fs(const svn_test_opts_t *opts, + apr_pool_t *pool) +{ + svn_fs_t *fs; + svn_fs_txn_t *txn; + svn_fs_root_t *txn_root; + const char *conflict; + svn_revnum_t after_rev; + svn_string_t *prop_value; + apr_pool_t *subpool; + + /* Bail (with success) on known-untestable scenarios */ + if ((strcmp(opts->fs_type, "fsfs") != 0) + || (opts->server_minor_version && (opts->server_minor_version < 7))) + return SVN_NO_ERROR; + + /* Create the packed FS and open it. */ + SVN_ERR(create_packed_filesystem(REPO_NAME, opts, MAX_REV, SHARD_SIZE, pool)); + SVN_ERR(svn_fs_open(&fs, REPO_NAME, NULL, pool)); + + subpool = svn_pool_create(pool); + /* Do a commit to trigger packing. */ + SVN_ERR(svn_fs_begin_txn(&txn, fs, MAX_REV + 1, subpool)); + SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool)); + SVN_ERR(svn_test__set_file_contents(txn_root, "iota", "new-iota", subpool)); + SVN_ERR(svn_fs_commit_txn(&conflict, &after_rev, txn, subpool)); + svn_pool_clear(subpool); + + /* Pack the repository. */ + SVN_ERR(svn_fs_pack(REPO_NAME, NULL, NULL, NULL, NULL, pool)); + + /* Try to get revprop for revision 0. */ + SVN_ERR(svn_fs_revision_prop(&prop_value, fs, 0, SVN_PROP_REVISION_AUTHOR, pool)); + + /* Try to change revprop for revision 0. */ + SVN_ERR(svn_fs_change_rev_prop(fs, 0, SVN_PROP_REVISION_AUTHOR, + svn_string_create("tweaked-author", pool), pool)); + + return SVN_NO_ERROR; +} + /* ------------------------------------------------------------------------ */ /* The test table. */ @@ -356,5 +403,7 @@ "read from a packed FSFS filesystem"), SVN_TEST_OPTS_PASS(commit_packed_fs, "commit to a packed FSFS filesystem"), + SVN_TEST_OPTS_XFAIL(get_set_revprop_packed_fs, + "get/set revprop while packing FSFS filesystem"), SVN_TEST_NULL };