You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2015/05/06 16:22:52 UTC
svn commit: r1678004 [3/3] - in /subversion/trunk: build.conf
subversion/tests/libsvn_fs/fs-sequential-test.c
subversion/tests/libsvn_fs/fs-test.c
Modified: subversion/trunk/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs/fs-test.c?rev=1678004&r1=1678003&r2=1678004&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs/fs-test.c Wed May 6 14:22:51 2015
@@ -5610,100 +5610,6 @@ dir_prop_merge(const svn_test_opts_t *op
return SVN_NO_ERROR;
}
-#if APR_HAS_THREADS
-struct reopen_modify_baton_t {
- const char *fs_path;
- const char *txn_name;
- apr_pool_t *pool;
- svn_error_t *err;
-};
-
-static void * APR_THREAD_FUNC
-reopen_modify_child(apr_thread_t *tid, void *data)
-{
- struct reopen_modify_baton_t *baton = data;
- svn_fs_t *fs;
- svn_fs_txn_t *txn;
- svn_fs_root_t *root;
-
- baton->err = svn_fs_open(&fs, baton->fs_path, NULL, baton->pool);
- if (!baton->err)
- baton->err = svn_fs_open_txn(&txn, fs, baton->txn_name, baton->pool);
- if (!baton->err)
- baton->err = svn_fs_txn_root(&root, txn, baton->pool);
- if (!baton->err)
- baton->err = svn_fs_change_node_prop(root, "A", "name",
- svn_string_create("value",
- baton->pool),
- baton->pool);
- svn_pool_destroy(baton->pool);
- apr_thread_exit(tid, 0);
- return NULL;
-}
-#endif
-
-static svn_error_t *
-reopen_modify(const svn_test_opts_t *opts,
- apr_pool_t *pool)
-{
-#if APR_HAS_THREADS
- svn_fs_t *fs;
- svn_revnum_t head_rev = 0;
- svn_fs_root_t *root;
- svn_fs_txn_t *txn;
- const char *fs_path, *txn_name;
- svn_string_t *value;
- struct reopen_modify_baton_t baton;
- apr_status_t status, child_status;
- apr_threadattr_t *tattr;
- apr_thread_t *tid;
-
- /* Create test repository with greek tree. */
- fs_path = "test-reopen-modify";
- SVN_ERR(svn_test__create_fs(&fs, fs_path, opts, pool));
- SVN_ERR(svn_fs_begin_txn(&txn, fs, head_rev, pool));
- SVN_ERR(svn_fs_txn_root(&root, txn, pool));
- SVN_ERR(svn_test__create_greek_tree(root, pool));
- SVN_ERR(test_commit_txn(&head_rev, txn, NULL, pool));
-
- /* Create txn with changes. */
- SVN_ERR(svn_fs_begin_txn(&txn, fs, head_rev, pool));
- SVN_ERR(svn_fs_txn_name(&txn_name, txn, pool));
- SVN_ERR(svn_fs_txn_root(&root, txn, pool));
- SVN_ERR(svn_fs_make_dir(root, "X", pool));
-
- /* In another thread: reopen fs and txn, and add more changes. This
- works in BDB and FSX but in FSFS the txn_dir_cache becomes
- out-of-date and the thread's changes don't reach the revision. */
- baton.fs_path = fs_path;
- baton.txn_name = txn_name;
- baton.pool = svn_pool_create(pool);
- status = apr_threadattr_create(&tattr, pool);
- if (status)
- return svn_error_wrap_apr(status, _("Can't create threadattr"));
- status = apr_thread_create(&tid, tattr, reopen_modify_child, &baton, pool);
- if (status)
- return svn_error_wrap_apr(status, _("Can't create thread"));
- status = apr_thread_join(&child_status, tid);
- if (status)
- return svn_error_wrap_apr(status, _("Can't join thread"));
- if (baton.err)
- return svn_error_trace(baton.err);
-
- /* Commit */
- SVN_ERR(test_commit_txn(&head_rev, txn, NULL, pool));
-
- /* Check for change made by thread. */
- SVN_ERR(svn_fs_revision_root(&root, fs, head_rev, pool));
- SVN_ERR(svn_fs_node_prop(&value, root, "A", "name", pool));
- SVN_TEST_ASSERT(value && !strcmp(value->data, "value"));
-
- return SVN_NO_ERROR;
-#else
- return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL, "no thread support");
-#endif
-}
-
static svn_error_t *
upgrade_while_committing(const svn_test_opts_t *opts,
apr_pool_t *pool)
@@ -7079,9 +6985,6 @@ static struct svn_test_descriptor_t test
"test svn_fs__compatible_version"),
SVN_TEST_OPTS_PASS(dir_prop_merge,
"test merge directory properties"),
- SVN_TEST_OPTS_XFAIL_OTOH(reopen_modify,
- "test reopen and modify txn",
- SVN_TEST_PASS_IF_FS_TYPE_IS_NOT("fsfs")),
SVN_TEST_OPTS_PASS(upgrade_while_committing,
"upgrade while committing"),
SVN_TEST_OPTS_PASS(test_paths_changed,