Skip to content

Commit aefefc5

Browse files
dschoKevin Willford
authored and
Kevin Willford
committed
Merge 'gvfs/midx-fix-flakey-offset-test'
The MIDX selects between duplicate copies of objects by selecting the most-recently-modified pack-file. This modified time is stored in seconds, so if t5319-midx.sh runs quickly, the IDX containing the 64-bit offsets may have the same modified time as the IDX files created earlier. This can create test failures because we do not create the large offset chunk if our MIDX write does not pick the corrupted IDX file. Remove this issue from possibility by only having one IDX file in the 64-bit test. Signed-off-by: Derrick Stolee <[email protected]>
2 parents 4e419c1 + 00a077f commit aefefc5

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

t/t5319-midx.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,17 +228,19 @@ test_expect_success 'force some 64-bit offsets with pack-objects' '
228228
pack64=$(git pack-objects --index-version=2,0x40 test-64 <obj-list) &&
229229
idx64=$(ls test-64-*idx) &&
230230
chmod u+w $idx64 &&
231-
corrupt_data $idx64 2863 "\02" &&
232-
midx64=$(git midx --write --pack-dir .) &&
233-
git midx --read --pack-dir . --midx-id=$midx64 >midx-read-out-64 &&
234-
echo "header: 4d494458 80000001 01 14 00 06 0000000e" >midx-read-expect-64 &&
235-
echo "num_objects: 77" >>midx-read-expect-64 &&
231+
mkdir packs-64 &&
232+
mv test-64* packs-64/ &&
233+
corrupt_data packs-64/$idx64 2863 "\02" &&
234+
midx64=$(git midx --write --pack-dir packs-64) &&
235+
git midx --read --pack-dir packs-64 --midx-id=$midx64 >midx-read-out-64 &&
236+
echo "header: 4d494458 80000001 01 14 00 06 00000001" >midx-read-expect-64 &&
237+
echo "num_objects: 65" >>midx-read-expect-64 &&
236238
echo "chunks: pack_lookup pack_names oid_fanout oid_lookup object_offsets large_offsets" >>midx-read-expect-64 &&
237239
echo "pack_names:" >>midx-read-expect-64 &&
238-
ls test-*.pack | sort >>midx-read-expect-64 &&
239-
echo "pack_dir: ." >>midx-read-expect-64 &&
240+
echo test-64-$pack64.pack >>midx-read-expect-64 &&
241+
echo "pack_dir: packs-64" >>midx-read-expect-64 &&
240242
test_cmp midx-read-out-64 midx-read-expect-64 &&
241-
rm midx-$midx64.midx test-64*
243+
rm -rf packs-64
242244
'
243245

244246
test_done

0 commit comments

Comments
 (0)