tests: make test-fb-hgext-remotefilelog-ruststores-lfs.t reliable

Summary:
This test is flaky due to `hg up` not always reading data from the stores, and
thus not always failing to reading the LFS blob. A better way to force read
from the store is to simply use `hg log -p` to read from the stores.

Reviewed By: DurhamG, singhsrb

Differential Revision: D23718823

fbshipit-source-id: 98bc37a76e93a67d031ba7bfa124b1db816983a1
This commit is contained in:
Xavier Deguillard 2020-09-15 18:56:16 -07:00 committed by Facebook GitHub Bot
parent 1d6b75dc69
commit 3ac8b21b2e

View File

@ -20,16 +20,28 @@
$ setconfig remotefilelog.lfs=True
# Verify that without the one-time repack, we can't read the LFS blobs.
$ hg up null 2> /dev/null
$ hg log -p -r . 2> /dev/null
[1]
# Now do the one time repack
$ setconfig remotefilelog.maintenance.timestamp.localrepack=1 remotefilelog.maintenance=localrepack
$ hg up null
$ hg log -p -r .
Running a one-time local repack, this may take some time
Done with one-time local repack
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
commit: ab1b0b8595ed
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: x
diff -r 000000000000 -r ab1b0b8595ed x
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/x Thu Jan 01 00:00:00 1970 +0000
@@ -0,0 +1,1 @@
+THIS IS AN LFS BLOB
$ hg up null
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg up -r tip
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cat x