2 test_description="locking"
3 . $(dirname "$0")/test-lib.sh || exit 1
7 test_begin_subtest "blocking open"
8 if [ $NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK -ne 1 ]; then
9 test_subtest_known_broken
11 test_C ${MAIL_DIR} <<'EOF'
15 #include <notmuch-test.h>
18 taggit (notmuch_database_t *db, const char *tag)
20 notmuch_message_t *message;
22 EXPECT0 (notmuch_database_find_message (db, "4EFC743A.3060609@april.org", &message));
23 if (message == NULL) {
24 fprintf (stderr, "unable to find message");
28 EXPECT0 (notmuch_message_add_tag (message, tag));
29 notmuch_message_destroy (message);
33 main (int argc, char **argv)
36 const char *path = argv[1];
40 fprintf (stderr, "fork failed\n");
45 notmuch_database_t *db2;
48 EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, &db2));
49 taggit (db2, "child");
50 EXPECT0 (notmuch_database_close (db2));
52 notmuch_database_t *db;
54 EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, &db));
55 taggit (db, "parent");
57 EXPECT0 (notmuch_database_close (db));
63 notmuch search --output=tags id:4EFC743A.3060609@april.org >> OUTPUT
72 if [ $NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK -ne 1 ]; then
73 test_subtest_known_broken
75 test_expect_equal_file EXPECTED OUTPUT