'qsx' reported a bug on #notmuch with notmuch-dump and large stored
queries. This test will pass (on my machine) if the value of `repeat'
is made smaller.
 test/T240-dump-restore.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/test/T240-dump-restore.sh b/test/T240-dump-restore.sh
index 0870ff92..374db5c2 100755
--- a/test/T240-dump-restore.sh
+++ b/test/T240-dump-restore.sh
@@ -322,6 +322,19 @@ EOF
 test_expect_equal_file EXPECTED OUTPUT
+test_begin_subtest 'dumping large queries'
+# This value repeat was found experimentally by binary search. The
+# config value after URL encoding is exactly 4096 bytes, which
+# suggests a buffer size bug.
+notmuch config set query.big "$(seq -s' ' $repeat)"
+notmuch dump --include=config > OUTPUT
+notmuch config set query.big ''
+printf "#notmuch-dump batch-tag:3 config\n#@ query.big " > EXPECTED
+seq -s'%20'  $repeat >> EXPECTED
+test_expect_equal_file EXPECTED OUTPUT
 test_begin_subtest 'roundtripping random message-ids and tags'
     ${TEST_DIRECTORY}/random-corpus --config-path=${NOTMUCH_CONFIG} \

notmuch mailing list

Reply via email to