sapling/eden/scm/tests/test-fsmonitor-warn-fresh.t
Jun Wu f11d555a3a fsmonitor: add threshold of nonnormal files to update
Summary:
Previously, the fsmonitor state update logic will skip updating treestate if the wlock
cannot be obtained. D17468790 (8d4d0a66a2) made it wait for wlock for the painful "watchman fresh
instance" case. But things can still suck if it's not a "fresh instance" but there are just
too many nonnormal files.

This diff makes it that exceeding a threshold of nonnormal files will trigger a fsmonitor
state write as an attempt to to reduce the number of nonnormal files. In additional,
`--debug` was changed to print more internal states for debugging.

This would hopefully address issues where people have a large "nonnormal"
treestate, suffers from the bad performance issue and cannot recover from it
automatically.

Reviewed By: DurhamG

Differential Revision: D25794083

fbshipit-source-id: 741426cf31484d9318f9cfcab11d38da33ab5067
2021-01-12 16:26:48 -08:00

35 lines
873 B
Perl

#require fsmonitor
$ setconfig fsmonitor.warn-fresh-instance=true
$ newrepo
A warning is printed for the first use
$ hg status --debug
warning: watchman has recently started (pid *) - operation will be slower than usual (glob)
poststatusfixup decides to wait for wlock since watchman reported fresh instance
$ hg status --debug
Force waiting for the lock
$ touch A
$ hg add A
$ echo 1 > A
$ hg status --debug --config fsmonitor.dirstate-nonnormal-file-threshold=0
poststatusfixup decides to wait for wlock since nonnormal file count 1 >= 0
A A
$ hg debugstatus
len(dirstate) = 1
len(nonnormal) = 1
len(filtered nonnormal) = 1
clock = * (glob)
hg status on a non-utf8 filename
$ touch foo
$ python2 -c 'open(b"\xc3\x28", "wb+").write("asdf")'
$ hg status --traceback
skipping invalid utf-8 filename: '*' (glob)
A A
? foo