]> git.notmuchmail.org Git - notmuch/commitdiff
test: don't use dump and restore in a pipeline
authorDavid Bremner <david@tethera.net>
Tue, 28 Jun 2016 08:24:07 +0000 (10:24 +0200)
committerDavid Bremner <david@tethera.net>
Wed, 29 Jun 2016 07:03:14 +0000 (09:03 +0200)
This has been wrong since bbbdf0478ea, but the race condition was not
previously been (often?) triggered in the tests. With the DB_RETRY_LOCK
patches, it manifests itself as a deadlock.

test/T240-dump-restore.sh

index bbfb09b928b0d322bd71cb57736596880299efce..faa10364acf52a19a9553ebe515b4bb01bd81b61 100755 (executable)
@@ -135,7 +135,8 @@ test_expect_equal_file EXPECTED OUT
 
 test_begin_subtest "format=batch-tag, # round-trip"
 notmuch dump --format=sup | sort > EXPECTED.$test_count
 
 test_begin_subtest "format=batch-tag, # round-trip"
 notmuch dump --format=sup | sort > EXPECTED.$test_count
-notmuch dump --format=batch-tag | notmuch restore --format=batch-tag
+notmuch dump --format=batch-tag > DUMPFILE
+notmuch restore --format=batch-tag < DUMPFILE
 notmuch dump --format=sup | sort > OUTPUT.$test_count
 test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
 
 notmuch dump --format=sup | sort > OUTPUT.$test_count
 test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
 
@@ -212,7 +213,8 @@ test_expect_equal_file EXPECTED OUTPUT.$test_count
 
 test_begin_subtest 'format=batch-tag, round trip with strange tags'
 notmuch dump --format=batch-tag > EXPECTED.$test_count
 
 test_begin_subtest 'format=batch-tag, round trip with strange tags'
 notmuch dump --format=batch-tag > EXPECTED.$test_count
-notmuch dump --format=batch-tag | notmuch restore --format=batch-tag
+notmuch dump --format=batch-tag > DUMPFILE
+notmuch restore --format=batch-tag < DUMPFILE
 notmuch dump --format=batch-tag > OUTPUT.$test_count
 test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
 
 notmuch dump --format=batch-tag > OUTPUT.$test_count
 test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count