@@ -49,7 +49,8 @@ test_expect_success 'load kvs and create some kvs content' '
4949 flux kvs put --no-merge x=$(cat x.val) &&
5050 flux kvs link --target-namespace=smurf otherthing z &&
5151 flux kvs put --no-merge w= &&
52- flux kvs put --no-merge --append w=foo
52+ flux kvs put --no-merge --append w=foo &&
53+ flux kvs put --no-merge --append w=bar
5354'
5455test_expect_success ' unload kvs' '
5556 flux module remove kvs
@@ -81,16 +82,16 @@ test_expect_success 'unload content-sqlite' '
8182# (1) rootdir 5th version (z is contained in root)
8283# (1) rootdir 6th version (w probably contained in root)
8384# (3) rootdir 7th version ('w' empty blobref + append to 'w')
84- # Total: 12 blobs
85+ # (2) rootdir 8th version (append to 'w')
86+ # Total: 14 blobs
8587#
8688test_expect_success ' count blobs representing those five keys' '
87- echo 12 >blobcount.exp &&
89+ echo 14 >blobcount.exp &&
8890 countblobs >blobcount.out &&
8991 test_cmp blobcount.exp blobcount.out
9092'
91- test_expect_success ' remove backing file and load content-sqlite' '
92- rm -f content.sqlite &&
93- flux module load content-sqlite
93+ test_expect_success ' load content-sqlite and truncate old file to start fresh' '
94+ flux module load content-sqlite truncate
9495'
9596test_expect_success ' restore content' '
9697 flux restore --checkpoint foo.tar
@@ -111,7 +112,8 @@ test_expect_success 'unload content-sqlite' '
111112'
112113
113114# Intermediate rootdir versions are not preserved across dump/restore.
114- # Expect a blobcount of 4: rootdir 5th version + 'a' + 'b' + 'x',
115+ # Expect a blobcount of 4: rootdir 8th version + 'a' + 'b' + 'x',
116+ # N.B. 'w' is now contained in the root
115117#
116118test_expect_success ' count blobs after restore' \' s' implicit garbage collection' '
117119 echo 4 >blobcount2.exp &&
@@ -129,7 +131,7 @@ test_expect_success 'verify that exact KVS content was restored' '
129131 test $(flux kvs get x) = $(cat x.val) &&
130132 test $(flux kvs readlink y) = "linkedthing" &&
131133 test $(flux kvs readlink z) = "smurf::otherthing" &&
132- test $(flux kvs get w) = "foo "
134+ test $(flux kvs get w) = "foobar "
133135'
134136test_expect_success ' now restore to key and verify content' '
135137 flux restore -v --key zz foo.tar &&
@@ -255,6 +257,44 @@ test_expect_success UTF8_LOCALE 'restore UTF-8 dump' '
255257 flux kvs get ƒuzzybunny)
256258'
257259
260+ # Cover value with a very large number of appends
261+
262+ test_expect_success LONGTEST ' load content-sqlite and truncate old file to start fresh' '
263+ flux module load content-sqlite truncate
264+ '
265+ # N.B. from 1000 to 3000 instead of 0 to 2000, easier to debug errors
266+ # using fold(1) (i.e. all numbers same width)
267+ test_expect_success LONGTEST ' load kvs and create some kvs content' '
268+ flux module load kvs &&
269+ for i in `seq 1000 3000`; do
270+ flux kvs put --append bigval=${i}
271+ done &&
272+ flux kvs get bigval > bigval.exp
273+ '
274+ test_expect_success LONGTEST ' unload kvs' '
275+ flux module remove kvs
276+ '
277+ test_expect_success LONGTEST ' dump default=kvs-primary checkpoint' '
278+ flux dump --checkpoint bigval.tar
279+ '
280+ test_expect_success LONGTEST ' reload content-sqlite, truncate old file to start fresh' '
281+ flux module reload content-sqlite truncate
282+ '
283+ test_expect_success LONGTEST ' restore content' '
284+ flux restore --checkpoint bigval.tar
285+ '
286+ test_expect_success LONGTEST ' load kvs and check bigval value' '
287+ flux module load kvs &&
288+ flux kvs get bigval > bigval.out &&
289+ test_cmp bigval.out bigval.exp
290+ '
291+ test_expect_success LONGTEST ' unload kvs' '
292+ flux module remove kvs
293+ '
294+ test_expect_success LONGTEST ' unload content-sqlite' '
295+ flux module remove content-sqlite
296+ '
297+
258298# Cover --size-limit
259299
260300test_expect_success ' create bigdump.tar with a 12M blob in it' '
0 commit comments